Skip to content

Commit 430739b

Browse files
Add users API endpoints
1 parent 0784fad commit 430739b

9 files changed

Lines changed: 168 additions & 97 deletions

File tree

api-reference/platform/projects/create-a-project.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
openapi: post /projects
33
---
44

5-
<Warning>This endpoint can only be called with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>
5+
<Warning>This endpoint can only be used with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>

api-reference/platform/projects/delete-a-project.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
openapi: delete /projects/{projectId}
33
---
44

5-
<Warning>This endpoint can only be called with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>
5+
<Warning>This endpoint can only be used with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
---
22
openapi: get /projects/{projectId}
33
---
4-
5-
<Warning>This endpoint can only be called with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>

api-reference/platform/projects/list-projects.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
openapi: get /projects
33
---
44

5-
<Warning>This endpoint can only be called with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>
5+
<Warning>This endpoint can only be used with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
---
22
openapi: post /projects/{projectId}
33
---
4-
5-
<Warning>This endpoint can only be called with an [organization-scoped](/api-reference/introduction#organization-scoped-api-keys) API key.</Warning>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
openapi: get /users/{userId}
3+
---
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
openapi: get /users
3+
---

docs.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@
7474
"api-reference/platform/projects/delete-a-project"
7575
]
7676
},
77+
{
78+
"group": "Users",
79+
"pages": [
80+
"api-reference/platform/users/list-users",
81+
"api-reference/platform/users/get-a-user"
82+
]
83+
},
7784
{
7885
"group": "Alert Rules",
7986
"pages": [

openapi.json

Lines changed: 152 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -339,96 +339,6 @@
339339
}
340340
}
341341
},
342-
"/project": {
343-
"get": {
344-
"tags": [
345-
"Projects"
346-
],
347-
"summary": "Get current project",
348-
"description": "Get the current project based on the API key project scope.",
349-
"operationId": "getCurrentProject",
350-
"responses": {
351-
"200": {
352-
"description": "Success, current project retrieved",
353-
"content": {
354-
"application/json": {
355-
"schema": {
356-
"$ref": "#/components/schemas/Platform.Project.Resource"
357-
}
358-
}
359-
}
360-
},
361-
"401": {
362-
"$ref": "#/components/responses/401"
363-
},
364-
"403": {
365-
"$ref": "#/components/responses/403"
366-
}
367-
},
368-
"parameters": [
369-
{
370-
"$ref": "#/components/parameters/page"
371-
},
372-
{
373-
"$ref": "#/components/parameters/per_page"
374-
},
375-
{
376-
"$ref": "#/components/parameters/header_project_id"
377-
},
378-
{
379-
"$ref": "#/components/parameters/header_project_slug"
380-
}
381-
]
382-
},
383-
"post": {
384-
"tags": [
385-
"Projects"
386-
],
387-
"summary": "Update current project",
388-
"description": "Update the current project based on the API key project scope.",
389-
"operationId": "updateCurrentProject",
390-
"requestBody": {
391-
"description": "Project request",
392-
"required": true,
393-
"content": {
394-
"application/json": {
395-
"schema": {
396-
"$ref": "#/components/schemas/Platform.Project.Request"
397-
}
398-
}
399-
}
400-
},
401-
"responses": {
402-
"200": {
403-
"description": "Success, current project updated",
404-
"content": {
405-
"application/json": {
406-
"schema": {
407-
"$ref": "#/components/schemas/Platform.Project.Resource"
408-
}
409-
}
410-
}
411-
},
412-
"401": {
413-
"$ref": "#/components/responses/401"
414-
},
415-
"403": {
416-
"$ref": "#/components/responses/403"
417-
},
418-
"422": {
419-
"$ref": "#/components/responses/422"
420-
}
421-
},
422-
"parameters": [
423-
{
424-
"$ref": "#/components/parameters/header_project_id"
425-
},
426-
{
427-
"$ref": "#/components/parameters/header_project_slug"
428-
}
429-
]
430-
}
431-
},
432342
"/projects": {
433343
"get": {
434344
"tags": [
@@ -648,6 +558,118 @@
648558
}
649559
}
650560
},
561+
"/users": {
562+
"get": {
563+
"tags": [
564+
"Users"
565+
],
566+
"summary": "List users",
567+
"description": "Get a paginated list of users.",
568+
"operationId": "getUsers",
569+
"parameters": [
570+
{
571+
"name": "email",
572+
"in": "query",
573+
"description": "Filter users by email. Use a comma-separated list to specify multiple email addresses.",
574+
"required": false,
575+
"schema": {
576+
"type": "string"
577+
}
578+
},
579+
{
580+
"$ref": "#/components/parameters/page"
581+
},
582+
{
583+
"$ref": "#/components/parameters/per_page"
584+
},
585+
{
586+
"$ref": "#/components/parameters/header_project_id"
587+
},
588+
{
589+
"$ref": "#/components/parameters/header_project_slug"
590+
}
591+
],
592+
"responses": {
593+
"200": {
594+
"description": "Success, users retrieved",
595+
"content": {
596+
"application/json": {
597+
"schema": {
598+
"properties": {
599+
"data": {
600+
"items": {
601+
"$ref": "#/components/schemas/Platform.User.Resource"
602+
}
603+
},
604+
"meta": {
605+
"$ref": "#/components/schemas/meta"
606+
},
607+
"links": {
608+
"$ref": "#/components/schemas/links"
609+
}
610+
},
611+
"type": "object"
612+
}
613+
}
614+
}
615+
},
616+
"401": {
617+
"$ref": "#/components/responses/401"
618+
},
619+
"403": {
620+
"$ref": "#/components/responses/403"
621+
}
622+
}
623+
}
624+
},
625+
"/users/{userId}": {
626+
"get": {
627+
"tags": [
628+
"Users"
629+
],
630+
"summary": "Get a user",
631+
"description": "Get a user by ID",
632+
"operationId": "getUser",
633+
"parameters": [
634+
{
635+
"name": "userId",
636+
"in": "path",
637+
"description": "ID of the user to show",
638+
"required": true,
639+
"schema": {
640+
"type": "integer"
641+
}
642+
},
643+
{
644+
"$ref": "#/components/parameters/header_project_id"
645+
},
646+
{
647+
"$ref": "#/components/parameters/header_project_slug"
648+
}
649+
],
650+
"responses": {
651+
"200": {
652+
"description": "Success, user retrieved",
653+
"content": {
654+
"application/json": {
655+
"schema": {
656+
"$ref": "#/components/schemas/Platform.User.Resource"
657+
}
658+
}
659+
}
660+
},
661+
"401": {
662+
"$ref": "#/components/responses/401"
663+
},
664+
"403": {
665+
"$ref": "#/components/responses/403"
666+
},
667+
"404": {
668+
"$ref": "#/components/responses/404"
669+
}
670+
}
671+
}
672+
},
651673
"/uptime/incidents": {
652674
"get": {
653675
"tags": [
@@ -2544,6 +2566,34 @@
25442566
}
25452567
}
25462568
},
2569+
"Platform.User.Resource": {
2570+
"properties": {
2571+
"id": {
2572+
"description": "User ID",
2573+
"type": "number",
2574+
"example": 1
2575+
},
2576+
"role": {
2577+
"$ref": "#/components/schemas/Phare.User.UserRoleEnum"
2578+
},
2579+
"email": {
2580+
"description": "User email",
2581+
"type": "string",
2582+
"example": "nicolas@phare.io"
2583+
},
2584+
"created_at": {
2585+
"description": "Date of creation for the entity",
2586+
"type": "string",
2587+
"format": "date-time"
2588+
},
2589+
"updated_at": {
2590+
"description": "Date of last update for the entity",
2591+
"type": "string",
2592+
"format": "date-time"
2593+
}
2594+
},
2595+
"type": "object"
2596+
},
25472597
"Platform.AlertRule": {
25482598
"required": [
25492599
"event",
@@ -3176,6 +3226,13 @@
31763226
"uptime.incident_update.published"
31773227
]
31783228
},
3229+
"Phare.User.UserRoleEnum": {
3230+
"type": "string",
3231+
"enum": [
3232+
"member",
3233+
"admin"
3234+
]
3235+
},
31793236
"Uptime.Incident.ImpactEnum": {
31803237
"type": "string",
31813238
"enum": [
@@ -3402,6 +3459,10 @@
34023459
}
34033460
],
34043461
"tags": [
3462+
{
3463+
"name": "Users",
3464+
"description": "Users"
3465+
},
34053466
{
34063467
"name": "Projects",
34073468
"description": "Projects"
@@ -3431,6 +3492,7 @@
34313492
{
34323493
"name": "Phare platform",
34333494
"tags": [
3495+
"Users",
34343496
"Projects",
34353497
"Alert Rules"
34363498
]

0 commit comments

Comments
 (0)