diff --git a/api/members/members_client/clusters/get_clusters_responses.go b/api/members/members_client/clusters/get_clusters_responses.go index 2727881..35caf33 100644 --- a/api/members/members_client/clusters/get_clusters_responses.go +++ b/api/members/members_client/clusters/get_clusters_responses.go @@ -79,9 +79,6 @@ GetClustersOK describes a response with status code 200, with default header val Response with Cluster objects */ type GetClustersOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.ClusterResponse } @@ -129,20 +126,6 @@ func (o *GetClustersOK) GetPayload() *members_models.ClusterResponse { func (o *GetClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.ClusterResponse) // response payload @@ -164,9 +147,6 @@ GetClustersUnauthorized describes a response with status code 401, with default Access Unauthorized, invalid API-KEY was used */ type GetClustersUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *GetClustersUnauthorized) GetPayload() *members_models.Error { func (o *GetClustersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ GetClustersUnprocessableEntity describes a response with status code 422, with d Unprocessable Entity, likely a bad parameter */ type GetClustersUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *GetClustersUnprocessableEntity) GetPayload() *members_models.Error { func (o *GetClustersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/clusters/post_clusters_responses.go b/api/members/members_client/clusters/post_clusters_responses.go index 03b3f1c..5fbecf6 100644 --- a/api/members/members_client/clusters/post_clusters_responses.go +++ b/api/members/members_client/clusters/post_clusters_responses.go @@ -79,9 +79,6 @@ PostClustersOK describes a response with status code 200, with default header va Response with Cluster objects */ type PostClustersOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.ClusterResponse } @@ -129,20 +126,6 @@ func (o *PostClustersOK) GetPayload() *members_models.ClusterResponse { func (o *PostClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.ClusterResponse) // response payload @@ -164,9 +147,6 @@ PostClustersUnauthorized describes a response with status code 401, with default Access Unauthorized, invalid API-KEY was used */ type PostClustersUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *PostClustersUnauthorized) GetPayload() *members_models.Error { func (o *PostClustersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ PostClustersUnprocessableEntity describes a response with status code 422, with Unprocessable Entity, likely a bad parameter */ type PostClustersUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *PostClustersUnprocessableEntity) GetPayload() *members_models.Error { func (o *PostClustersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/clusters/put_clusters_responses.go b/api/members/members_client/clusters/put_clusters_responses.go index c19f8db..9cb59bf 100644 --- a/api/members/members_client/clusters/put_clusters_responses.go +++ b/api/members/members_client/clusters/put_clusters_responses.go @@ -79,9 +79,6 @@ PutClustersOK describes a response with status code 200, with default header val Response with Cluster objects */ type PutClustersOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.ClusterResponse } @@ -129,20 +126,6 @@ func (o *PutClustersOK) GetPayload() *members_models.ClusterResponse { func (o *PutClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.ClusterResponse) // response payload @@ -164,9 +147,6 @@ PutClustersUnauthorized describes a response with status code 401, with default Access Unauthorized, invalid API-KEY was used */ type PutClustersUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *PutClustersUnauthorized) GetPayload() *members_models.Error { func (o *PutClustersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ PutClustersUnprocessableEntity describes a response with status code 422, with d Unprocessable Entity, likely a bad parameter */ type PutClustersUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *PutClustersUnprocessableEntity) GetPayload() *members_models.Error { func (o *PutClustersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/databases/get_databases_responses.go b/api/members/members_client/databases/get_databases_responses.go index 0381f56..ad728e2 100644 --- a/api/members/members_client/databases/get_databases_responses.go +++ b/api/members/members_client/databases/get_databases_responses.go @@ -156,9 +156,6 @@ GetDatabasesUnauthorized describes a response with status code 401, with default Access Unauthorized, invalid API-KEY was used */ type GetDatabasesUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -206,20 +203,6 @@ func (o *GetDatabasesUnauthorized) GetPayload() *members_models.Error { func (o *GetDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -395,9 +378,6 @@ GetDatabasesUnprocessableEntity describes a response with status code 422, with Unprocessable Entity, likely a bad parameter */ type GetDatabasesUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -445,20 +425,6 @@ func (o *GetDatabasesUnprocessableEntity) GetPayload() *members_models.Error { func (o *GetDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/databases/post_databases_responses.go b/api/members/members_client/databases/post_databases_responses.go index 785c73b..29b784a 100644 --- a/api/members/members_client/databases/post_databases_responses.go +++ b/api/members/members_client/databases/post_databases_responses.go @@ -156,9 +156,6 @@ PostDatabasesUnauthorized describes a response with status code 401, with defaul Access Unauthorized, invalid API-KEY was used */ type PostDatabasesUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -206,20 +203,6 @@ func (o *PostDatabasesUnauthorized) GetPayload() *members_models.Error { func (o *PostDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -395,9 +378,6 @@ PostDatabasesUnprocessableEntity describes a response with status code 422, with Unprocessable Entity, likely a bad parameter */ type PostDatabasesUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -445,20 +425,6 @@ func (o *PostDatabasesUnprocessableEntity) GetPayload() *members_models.Error { func (o *PostDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/databases/put_databases_responses.go b/api/members/members_client/databases/put_databases_responses.go index 65bf64f..e1594e4 100644 --- a/api/members/members_client/databases/put_databases_responses.go +++ b/api/members/members_client/databases/put_databases_responses.go @@ -156,9 +156,6 @@ PutDatabasesUnauthorized describes a response with status code 401, with default Access Unauthorized, invalid API-KEY was used */ type PutDatabasesUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -206,20 +203,6 @@ func (o *PutDatabasesUnauthorized) GetPayload() *members_models.Error { func (o *PutDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -395,9 +378,6 @@ PutDatabasesUnprocessableEntity describes a response with status code 422, with Unprocessable Entity, likely a bad parameter */ type PutDatabasesUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -445,20 +425,6 @@ func (o *PutDatabasesUnprocessableEntity) GetPayload() *members_models.Error { func (o *PutDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/members_client.go b/api/members/members_client/members_client.go index 5c6bc85..2a722e1 100644 --- a/api/members/members_client/members_client.go +++ b/api/members/members_client/members_client.go @@ -39,6 +39,7 @@ import ( "code.tnxs.net/vernonkeenan/lib/api/members/members_client/tickets" "code.tnxs.net/vernonkeenan/lib/api/members/members_client/transactions" "code.tnxs.net/vernonkeenan/lib/api/members/members_client/users" + "code.tnxs.net/vernonkeenan/lib/api/members/members_client/webhooks" ) // Default members HTTP client. @@ -108,6 +109,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Members { cli.Tickets = tickets.New(transport, formats) cli.Transactions = transactions.New(transport, formats) cli.Users = users.New(transport, formats) + cli.Webhooks = webhooks.New(transport, formats) return cli } @@ -202,6 +204,8 @@ type Members struct { Users users.ClientService + Webhooks webhooks.ClientService + Transport runtime.ClientTransport } @@ -233,4 +237,5 @@ func (c *Members) SetTransport(transport runtime.ClientTransport) { c.Tickets.SetTransport(transport) c.Transactions.SetTransport(transport) c.Users.SetTransport(transport) + c.Webhooks.SetTransport(transport) } diff --git a/api/members/members_client/templates/get_templates_responses.go b/api/members/members_client/templates/get_templates_responses.go index 0f031a5..19ab2e9 100644 --- a/api/members/members_client/templates/get_templates_responses.go +++ b/api/members/members_client/templates/get_templates_responses.go @@ -79,9 +79,6 @@ GetTemplatesOK describes a response with status code 200, with default header va Response with Template objects */ type GetTemplatesOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.TemplateResponse } @@ -129,20 +126,6 @@ func (o *GetTemplatesOK) GetPayload() *members_models.TemplateResponse { func (o *GetTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.TemplateResponse) // response payload @@ -164,9 +147,6 @@ GetTemplatesUnauthorized describes a response with status code 401, with default Access Unauthorized, invalid API-KEY was used */ type GetTemplatesUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *GetTemplatesUnauthorized) GetPayload() *members_models.Error { func (o *GetTemplatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ GetTemplatesUnprocessableEntity describes a response with status code 422, with Unprocessable Entity, likely a bad parameter */ type GetTemplatesUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *GetTemplatesUnprocessableEntity) GetPayload() *members_models.Error { func (o *GetTemplatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/templates/post_templates_responses.go b/api/members/members_client/templates/post_templates_responses.go index 319f7bf..48428da 100644 --- a/api/members/members_client/templates/post_templates_responses.go +++ b/api/members/members_client/templates/post_templates_responses.go @@ -79,9 +79,6 @@ PostTemplatesOK describes a response with status code 200, with default header v Response with Template objects */ type PostTemplatesOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.TemplateResponse } @@ -129,20 +126,6 @@ func (o *PostTemplatesOK) GetPayload() *members_models.TemplateResponse { func (o *PostTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.TemplateResponse) // response payload @@ -164,9 +147,6 @@ PostTemplatesUnauthorized describes a response with status code 401, with defaul Access Unauthorized, invalid API-KEY was used */ type PostTemplatesUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *PostTemplatesUnauthorized) GetPayload() *members_models.Error { func (o *PostTemplatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ PostTemplatesUnprocessableEntity describes a response with status code 422, with Unprocessable Entity, likely a bad parameter */ type PostTemplatesUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *PostTemplatesUnprocessableEntity) GetPayload() *members_models.Error { func (o *PostTemplatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/tenants/get_tenants_responses.go b/api/members/members_client/tenants/get_tenants_responses.go index a4809af..a31e23d 100644 --- a/api/members/members_client/tenants/get_tenants_responses.go +++ b/api/members/members_client/tenants/get_tenants_responses.go @@ -156,9 +156,6 @@ GetTenantsUnauthorized describes a response with status code 401, with default h Access Unauthorized, invalid API-KEY was used */ type GetTenantsUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -206,20 +203,6 @@ func (o *GetTenantsUnauthorized) GetPayload() *members_models.Error { func (o *GetTenantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -395,9 +378,6 @@ GetTenantsUnprocessableEntity describes a response with status code 422, with de Unprocessable Entity, likely a bad parameter */ type GetTenantsUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -445,20 +425,6 @@ func (o *GetTenantsUnprocessableEntity) GetPayload() *members_models.Error { func (o *GetTenantsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/tenants/post_tenants_responses.go b/api/members/members_client/tenants/post_tenants_responses.go index 99dde34..27f6c21 100644 --- a/api/members/members_client/tenants/post_tenants_responses.go +++ b/api/members/members_client/tenants/post_tenants_responses.go @@ -156,9 +156,6 @@ PostTenantsUnauthorized describes a response with status code 401, with default Access Unauthorized, invalid API-KEY was used */ type PostTenantsUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -206,20 +203,6 @@ func (o *PostTenantsUnauthorized) GetPayload() *members_models.Error { func (o *PostTenantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -395,9 +378,6 @@ PostTenantsUnprocessableEntity describes a response with status code 422, with d Unprocessable Entity, likely a bad parameter */ type PostTenantsUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -445,20 +425,6 @@ func (o *PostTenantsUnprocessableEntity) GetPayload() *members_models.Error { func (o *PostTenantsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/tenants/put_tenants_responses.go b/api/members/members_client/tenants/put_tenants_responses.go index 980f53c..454dd25 100644 --- a/api/members/members_client/tenants/put_tenants_responses.go +++ b/api/members/members_client/tenants/put_tenants_responses.go @@ -156,9 +156,6 @@ PutTenantsUnauthorized describes a response with status code 401, with default h Access Unauthorized, invalid API-KEY was used */ type PutTenantsUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -206,20 +203,6 @@ func (o *PutTenantsUnauthorized) GetPayload() *members_models.Error { func (o *PutTenantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -395,9 +378,6 @@ PutTenantsUnprocessableEntity describes a response with status code 422, with de Unprocessable Entity, likely a bad parameter */ type PutTenantsUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -445,20 +425,6 @@ func (o *PutTenantsUnprocessableEntity) GetPayload() *members_models.Error { func (o *PutTenantsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/users/get_users_parameters.go b/api/members/members_client/users/get_users_parameters.go index ab4365c..ad138ab 100644 --- a/api/members/members_client/users/get_users_parameters.go +++ b/api/members/members_client/users/get_users_parameters.go @@ -72,6 +72,12 @@ type GetUsersParams struct { */ Auth0UserID *string + /* ContactID. + + Internal Contact ID (links to Account) + */ + ContactID *string + /* Email. Email address @@ -94,6 +100,12 @@ type GetUsersParams struct { */ Offset *int64 + /* UserID. + + Internal User ID + */ + UserID *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -158,6 +170,17 @@ func (o *GetUsersParams) SetAuth0UserID(auth0UserID *string) { o.Auth0UserID = auth0UserID } +// WithContactID adds the contactID to the get users params +func (o *GetUsersParams) WithContactID(contactID *string) *GetUsersParams { + o.SetContactID(contactID) + return o +} + +// SetContactID adds the contactId to the get users params +func (o *GetUsersParams) SetContactID(contactID *string) { + o.ContactID = contactID +} + // WithEmail adds the email to the get users params func (o *GetUsersParams) WithEmail(email *string) *GetUsersParams { o.SetEmail(email) @@ -191,6 +214,17 @@ func (o *GetUsersParams) SetOffset(offset *int64) { o.Offset = offset } +// WithUserID adds the userID to the get users params +func (o *GetUsersParams) WithUserID(userID *string) *GetUsersParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get users params +func (o *GetUsersParams) SetUserID(userID *string) { + o.UserID = userID +} + // WriteToRequest writes these params to a swagger request func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -216,6 +250,23 @@ func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi } } + if o.ContactID != nil { + + // query param contactId + var qrContactID string + + if o.ContactID != nil { + qrContactID = *o.ContactID + } + qContactID := qrContactID + if qContactID != "" { + + if err := r.SetQueryParam("contactId", qContactID); err != nil { + return err + } + } + } + if o.Email != nil { // query param email @@ -267,6 +318,23 @@ func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi } } + if o.UserID != nil { + + // query param userId + var qrUserID string + + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + + if err := r.SetQueryParam("userId", qUserID); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/api/members/members_client/users/get_users_responses.go b/api/members/members_client/users/get_users_responses.go index 38947b9..7da6613 100644 --- a/api/members/members_client/users/get_users_responses.go +++ b/api/members/members_client/users/get_users_responses.go @@ -79,9 +79,6 @@ GetUsersOK describes a response with status code 200, with default header values Response with User objects */ type GetUsersOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.UserResponse } @@ -129,20 +126,6 @@ func (o *GetUsersOK) GetPayload() *members_models.UserResponse { func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.UserResponse) // response payload @@ -164,9 +147,6 @@ GetUsersUnauthorized describes a response with status code 401, with default hea Access Unauthorized, invalid API-KEY was used */ type GetUsersUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *GetUsersUnauthorized) GetPayload() *members_models.Error { func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ GetUsersUnprocessableEntity describes a response with status code 422, with defa Unprocessable Entity, likely a bad parameter */ type GetUsersUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *GetUsersUnprocessableEntity) GetPayload() *members_models.Error { func (o *GetUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/users/post_users_onboard_parameters.go b/api/members/members_client/users/post_users_onboard_parameters.go new file mode 100644 index 0000000..40e06d5 --- /dev/null +++ b/api/members/members_client/users/post_users_onboard_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/members/members_models" +) + +// NewPostUsersOnboardParams creates a new PostUsersOnboardParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPostUsersOnboardParams() *PostUsersOnboardParams { + return &PostUsersOnboardParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostUsersOnboardParamsWithTimeout creates a new PostUsersOnboardParams object +// with the ability to set a timeout on a request. +func NewPostUsersOnboardParamsWithTimeout(timeout time.Duration) *PostUsersOnboardParams { + return &PostUsersOnboardParams{ + timeout: timeout, + } +} + +// NewPostUsersOnboardParamsWithContext creates a new PostUsersOnboardParams object +// with the ability to set a context for a request. +func NewPostUsersOnboardParamsWithContext(ctx context.Context) *PostUsersOnboardParams { + return &PostUsersOnboardParams{ + Context: ctx, + } +} + +// NewPostUsersOnboardParamsWithHTTPClient creates a new PostUsersOnboardParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostUsersOnboardParamsWithHTTPClient(client *http.Client) *PostUsersOnboardParams { + return &PostUsersOnboardParams{ + HTTPClient: client, + } +} + +/* +PostUsersOnboardParams contains all the parameters to send to the API endpoint + + for the post users onboard operation. + + Typically these are written to a http.Request. +*/ +type PostUsersOnboardParams struct { + + /* UserRequest. + + An array of User records + */ + UserRequest *members_models.UserRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post users onboard params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsersOnboardParams) WithDefaults() *PostUsersOnboardParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post users onboard params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsersOnboardParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post users onboard params +func (o *PostUsersOnboardParams) WithTimeout(timeout time.Duration) *PostUsersOnboardParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post users onboard params +func (o *PostUsersOnboardParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post users onboard params +func (o *PostUsersOnboardParams) WithContext(ctx context.Context) *PostUsersOnboardParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post users onboard params +func (o *PostUsersOnboardParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post users onboard params +func (o *PostUsersOnboardParams) WithHTTPClient(client *http.Client) *PostUsersOnboardParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post users onboard params +func (o *PostUsersOnboardParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUserRequest adds the userRequest to the post users onboard params +func (o *PostUsersOnboardParams) WithUserRequest(userRequest *members_models.UserRequest) *PostUsersOnboardParams { + o.SetUserRequest(userRequest) + return o +} + +// SetUserRequest adds the userRequest to the post users onboard params +func (o *PostUsersOnboardParams) SetUserRequest(userRequest *members_models.UserRequest) { + o.UserRequest = userRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostUsersOnboardParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UserRequest != nil { + if err := r.SetBodyParam(o.UserRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/members/members_client/users/post_users_onboard_responses.go b/api/members/members_client/users/post_users_onboard_responses.go new file mode 100644 index 0000000..3535d87 --- /dev/null +++ b/api/members/members_client/users/post_users_onboard_responses.go @@ -0,0 +1,504 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/members/members_models" +) + +// PostUsersOnboardReader is a Reader for the PostUsersOnboard structure. +type PostUsersOnboardReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostUsersOnboardReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostUsersOnboardOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostUsersOnboardUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostUsersOnboardForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostUsersOnboardNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostUsersOnboardUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostUsersOnboardInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostUsersOnboardOK creates a PostUsersOnboardOK with default headers values +func NewPostUsersOnboardOK() *PostUsersOnboardOK { + return &PostUsersOnboardOK{} +} + +/* +PostUsersOnboardOK describes a response with status code 200, with default header values. + +Response with User objects +*/ +type PostUsersOnboardOK struct { + Payload *members_models.UserResponse +} + +// IsSuccess returns true when this post users onboard o k response has a 2xx status code +func (o *PostUsersOnboardOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post users onboard o k response has a 3xx status code +func (o *PostUsersOnboardOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users onboard o k response has a 4xx status code +func (o *PostUsersOnboardOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this post users onboard o k response has a 5xx status code +func (o *PostUsersOnboardOK) IsServerError() bool { + return false +} + +// IsCode returns true when this post users onboard o k response a status code equal to that given +func (o *PostUsersOnboardOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the post users onboard o k response +func (o *PostUsersOnboardOK) Code() int { + return 200 +} + +func (o *PostUsersOnboardOK) Error() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardOK %+v", 200, o.Payload) +} + +func (o *PostUsersOnboardOK) String() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardOK %+v", 200, o.Payload) +} + +func (o *PostUsersOnboardOK) GetPayload() *members_models.UserResponse { + return o.Payload +} + +func (o *PostUsersOnboardOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(members_models.UserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersOnboardUnauthorized creates a PostUsersOnboardUnauthorized with default headers values +func NewPostUsersOnboardUnauthorized() *PostUsersOnboardUnauthorized { + return &PostUsersOnboardUnauthorized{} +} + +/* +PostUsersOnboardUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostUsersOnboardUnauthorized struct { + Payload *members_models.Error +} + +// IsSuccess returns true when this post users onboard unauthorized response has a 2xx status code +func (o *PostUsersOnboardUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users onboard unauthorized response has a 3xx status code +func (o *PostUsersOnboardUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users onboard unauthorized response has a 4xx status code +func (o *PostUsersOnboardUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users onboard unauthorized response has a 5xx status code +func (o *PostUsersOnboardUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this post users onboard unauthorized response a status code equal to that given +func (o *PostUsersOnboardUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the post users onboard unauthorized response +func (o *PostUsersOnboardUnauthorized) Code() int { + return 401 +} + +func (o *PostUsersOnboardUnauthorized) Error() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardUnauthorized %+v", 401, o.Payload) +} + +func (o *PostUsersOnboardUnauthorized) String() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardUnauthorized %+v", 401, o.Payload) +} + +func (o *PostUsersOnboardUnauthorized) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostUsersOnboardUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersOnboardForbidden creates a PostUsersOnboardForbidden with default headers values +func NewPostUsersOnboardForbidden() *PostUsersOnboardForbidden { + return &PostUsersOnboardForbidden{} +} + +/* +PostUsersOnboardForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostUsersOnboardForbidden struct { + AccessControlAllowOrigin string + + Payload *members_models.Error +} + +// IsSuccess returns true when this post users onboard forbidden response has a 2xx status code +func (o *PostUsersOnboardForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users onboard forbidden response has a 3xx status code +func (o *PostUsersOnboardForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users onboard forbidden response has a 4xx status code +func (o *PostUsersOnboardForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users onboard forbidden response has a 5xx status code +func (o *PostUsersOnboardForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this post users onboard forbidden response a status code equal to that given +func (o *PostUsersOnboardForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the post users onboard forbidden response +func (o *PostUsersOnboardForbidden) Code() int { + return 403 +} + +func (o *PostUsersOnboardForbidden) Error() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardForbidden %+v", 403, o.Payload) +} + +func (o *PostUsersOnboardForbidden) String() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardForbidden %+v", 403, o.Payload) +} + +func (o *PostUsersOnboardForbidden) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostUsersOnboardForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersOnboardNotFound creates a PostUsersOnboardNotFound with default headers values +func NewPostUsersOnboardNotFound() *PostUsersOnboardNotFound { + return &PostUsersOnboardNotFound{} +} + +/* +PostUsersOnboardNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostUsersOnboardNotFound struct { + AccessControlAllowOrigin string + + Payload *members_models.Error +} + +// IsSuccess returns true when this post users onboard not found response has a 2xx status code +func (o *PostUsersOnboardNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users onboard not found response has a 3xx status code +func (o *PostUsersOnboardNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users onboard not found response has a 4xx status code +func (o *PostUsersOnboardNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users onboard not found response has a 5xx status code +func (o *PostUsersOnboardNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this post users onboard not found response a status code equal to that given +func (o *PostUsersOnboardNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the post users onboard not found response +func (o *PostUsersOnboardNotFound) Code() int { + return 404 +} + +func (o *PostUsersOnboardNotFound) Error() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardNotFound %+v", 404, o.Payload) +} + +func (o *PostUsersOnboardNotFound) String() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardNotFound %+v", 404, o.Payload) +} + +func (o *PostUsersOnboardNotFound) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostUsersOnboardNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersOnboardUnprocessableEntity creates a PostUsersOnboardUnprocessableEntity with default headers values +func NewPostUsersOnboardUnprocessableEntity() *PostUsersOnboardUnprocessableEntity { + return &PostUsersOnboardUnprocessableEntity{} +} + +/* +PostUsersOnboardUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostUsersOnboardUnprocessableEntity struct { + Payload *members_models.Error +} + +// IsSuccess returns true when this post users onboard unprocessable entity response has a 2xx status code +func (o *PostUsersOnboardUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users onboard unprocessable entity response has a 3xx status code +func (o *PostUsersOnboardUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users onboard unprocessable entity response has a 4xx status code +func (o *PostUsersOnboardUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users onboard unprocessable entity response has a 5xx status code +func (o *PostUsersOnboardUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this post users onboard unprocessable entity response a status code equal to that given +func (o *PostUsersOnboardUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the post users onboard unprocessable entity response +func (o *PostUsersOnboardUnprocessableEntity) Code() int { + return 422 +} + +func (o *PostUsersOnboardUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostUsersOnboardUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostUsersOnboardUnprocessableEntity) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostUsersOnboardUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersOnboardInternalServerError creates a PostUsersOnboardInternalServerError with default headers values +func NewPostUsersOnboardInternalServerError() *PostUsersOnboardInternalServerError { + return &PostUsersOnboardInternalServerError{} +} + +/* +PostUsersOnboardInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostUsersOnboardInternalServerError struct { + AccessControlAllowOrigin string + + Payload *members_models.Error +} + +// IsSuccess returns true when this post users onboard internal server error response has a 2xx status code +func (o *PostUsersOnboardInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users onboard internal server error response has a 3xx status code +func (o *PostUsersOnboardInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users onboard internal server error response has a 4xx status code +func (o *PostUsersOnboardInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this post users onboard internal server error response has a 5xx status code +func (o *PostUsersOnboardInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this post users onboard internal server error response a status code equal to that given +func (o *PostUsersOnboardInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the post users onboard internal server error response +func (o *PostUsersOnboardInternalServerError) Code() int { + return 500 +} + +func (o *PostUsersOnboardInternalServerError) Error() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardInternalServerError %+v", 500, o.Payload) +} + +func (o *PostUsersOnboardInternalServerError) String() string { + return fmt.Sprintf("[POST /users/onboard][%d] postUsersOnboardInternalServerError %+v", 500, o.Payload) +} + +func (o *PostUsersOnboardInternalServerError) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostUsersOnboardInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/members/members_client/users/post_users_responses.go b/api/members/members_client/users/post_users_responses.go index 3bcef48..211331c 100644 --- a/api/members/members_client/users/post_users_responses.go +++ b/api/members/members_client/users/post_users_responses.go @@ -79,9 +79,6 @@ PostUsersOK describes a response with status code 200, with default header value Response with User objects */ type PostUsersOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.UserResponse } @@ -129,20 +126,6 @@ func (o *PostUsersOK) GetPayload() *members_models.UserResponse { func (o *PostUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.UserResponse) // response payload @@ -164,9 +147,6 @@ PostUsersUnauthorized describes a response with status code 401, with default he Access Unauthorized, invalid API-KEY was used */ type PostUsersUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *PostUsersUnauthorized) GetPayload() *members_models.Error { func (o *PostUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ PostUsersUnprocessableEntity describes a response with status code 422, with def Unprocessable Entity, likely a bad parameter */ type PostUsersUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *PostUsersUnprocessableEntity) GetPayload() *members_models.Error { func (o *PostUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/users/put_users_responses.go b/api/members/members_client/users/put_users_responses.go index 6d69a45..09f66b2 100644 --- a/api/members/members_client/users/put_users_responses.go +++ b/api/members/members_client/users/put_users_responses.go @@ -79,9 +79,6 @@ PutUsersOK describes a response with status code 200, with default header values Response with User objects */ type PutUsersOK struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.UserResponse } @@ -129,20 +126,6 @@ func (o *PutUsersOK) GetPayload() *members_models.UserResponse { func (o *PutUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.UserResponse) // response payload @@ -164,9 +147,6 @@ PutUsersUnauthorized describes a response with status code 401, with default hea Access Unauthorized, invalid API-KEY was used */ type PutUsersUnauthorized struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -214,20 +194,6 @@ func (o *PutUsersUnauthorized) GetPayload() *members_models.Error { func (o *PutUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload @@ -403,9 +369,6 @@ PutUsersUnprocessableEntity describes a response with status code 422, with defa Unprocessable Entity, likely a bad parameter */ type PutUsersUnprocessableEntity struct { - AccessControlAllowOrigin string - CacheControl string - Payload *members_models.Error } @@ -453,20 +416,6 @@ func (o *PutUsersUnprocessableEntity) GetPayload() *members_models.Error { func (o *PutUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - // hydrates response header Cache-Control - hdrCacheControl := response.GetHeader("Cache-Control") - - if hdrCacheControl != "" { - o.CacheControl = hdrCacheControl - } - o.Payload = new(members_models.Error) // response payload diff --git a/api/members/members_client/users/users_client.go b/api/members/members_client/users/users_client.go index c19a018..c9d6950 100644 --- a/api/members/members_client/users/users_client.go +++ b/api/members/members_client/users/users_client.go @@ -38,6 +38,8 @@ type ClientService interface { PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOK, error) + PostUsersOnboard(params *PostUsersOnboardParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOnboardOK, error) + PutUsers(params *PutUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutUsersOK, error) SetTransport(transport runtime.ClientTransport) @@ -125,6 +127,47 @@ func (a *Client) PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthI panic(msg) } +/* +PostUsersOnboard asyncs onboard new users + +Async onboard new users +*/ +func (a *Client) PostUsersOnboard(params *PostUsersOnboardParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOnboardOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostUsersOnboardParams() + } + op := &runtime.ClientOperation{ + ID: "postUsersOnboard", + Method: "POST", + PathPattern: "/users/onboard", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostUsersOnboardReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PostUsersOnboardOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for postUsersOnboard: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* PutUsers updates existing users diff --git a/api/members/members_client/webhooks/post_webhooks_clerk_parameters.go b/api/members/members_client/webhooks/post_webhooks_clerk_parameters.go new file mode 100644 index 0000000..0990391 --- /dev/null +++ b/api/members/members_client/webhooks/post_webhooks_clerk_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/members/members_models" +) + +// NewPostWebhooksClerkParams creates a new PostWebhooksClerkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPostWebhooksClerkParams() *PostWebhooksClerkParams { + return &PostWebhooksClerkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostWebhooksClerkParamsWithTimeout creates a new PostWebhooksClerkParams object +// with the ability to set a timeout on a request. +func NewPostWebhooksClerkParamsWithTimeout(timeout time.Duration) *PostWebhooksClerkParams { + return &PostWebhooksClerkParams{ + timeout: timeout, + } +} + +// NewPostWebhooksClerkParamsWithContext creates a new PostWebhooksClerkParams object +// with the ability to set a context for a request. +func NewPostWebhooksClerkParamsWithContext(ctx context.Context) *PostWebhooksClerkParams { + return &PostWebhooksClerkParams{ + Context: ctx, + } +} + +// NewPostWebhooksClerkParamsWithHTTPClient creates a new PostWebhooksClerkParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostWebhooksClerkParamsWithHTTPClient(client *http.Client) *PostWebhooksClerkParams { + return &PostWebhooksClerkParams{ + HTTPClient: client, + } +} + +/* +PostWebhooksClerkParams contains all the parameters to send to the API endpoint + + for the post webhooks clerk operation. + + Typically these are written to a http.Request. +*/ +type PostWebhooksClerkParams struct { + + /* WebhookclerkRequest. + + An array of new WebhookClerk records + */ + WebhookclerkRequest *members_models.WebhookClerkRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post webhooks clerk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostWebhooksClerkParams) WithDefaults() *PostWebhooksClerkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post webhooks clerk params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostWebhooksClerkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post webhooks clerk params +func (o *PostWebhooksClerkParams) WithTimeout(timeout time.Duration) *PostWebhooksClerkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post webhooks clerk params +func (o *PostWebhooksClerkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post webhooks clerk params +func (o *PostWebhooksClerkParams) WithContext(ctx context.Context) *PostWebhooksClerkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post webhooks clerk params +func (o *PostWebhooksClerkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post webhooks clerk params +func (o *PostWebhooksClerkParams) WithHTTPClient(client *http.Client) *PostWebhooksClerkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post webhooks clerk params +func (o *PostWebhooksClerkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithWebhookclerkRequest adds the webhookclerkRequest to the post webhooks clerk params +func (o *PostWebhooksClerkParams) WithWebhookclerkRequest(webhookclerkRequest *members_models.WebhookClerkRequest) *PostWebhooksClerkParams { + o.SetWebhookclerkRequest(webhookclerkRequest) + return o +} + +// SetWebhookclerkRequest adds the webhookclerkRequest to the post webhooks clerk params +func (o *PostWebhooksClerkParams) SetWebhookclerkRequest(webhookclerkRequest *members_models.WebhookClerkRequest) { + o.WebhookclerkRequest = webhookclerkRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostWebhooksClerkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.WebhookclerkRequest != nil { + if err := r.SetBodyParam(o.WebhookclerkRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/members/members_client/webhooks/post_webhooks_clerk_responses.go b/api/members/members_client/webhooks/post_webhooks_clerk_responses.go new file mode 100644 index 0000000..d0ab356 --- /dev/null +++ b/api/members/members_client/webhooks/post_webhooks_clerk_responses.go @@ -0,0 +1,504 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/members/members_models" +) + +// PostWebhooksClerkReader is a Reader for the PostWebhooksClerk structure. +type PostWebhooksClerkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostWebhooksClerkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPostWebhooksClerkCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostWebhooksClerkUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostWebhooksClerkForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostWebhooksClerkNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostWebhooksClerkUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostWebhooksClerkInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostWebhooksClerkCreated creates a PostWebhooksClerkCreated with default headers values +func NewPostWebhooksClerkCreated() *PostWebhooksClerkCreated { + return &PostWebhooksClerkCreated{} +} + +/* +PostWebhooksClerkCreated describes a response with status code 201, with default header values. + +WebhookClerk Response Object +*/ +type PostWebhooksClerkCreated struct { + Payload *members_models.WebhookClerkResponse +} + +// IsSuccess returns true when this post webhooks clerk created response has a 2xx status code +func (o *PostWebhooksClerkCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post webhooks clerk created response has a 3xx status code +func (o *PostWebhooksClerkCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post webhooks clerk created response has a 4xx status code +func (o *PostWebhooksClerkCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this post webhooks clerk created response has a 5xx status code +func (o *PostWebhooksClerkCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this post webhooks clerk created response a status code equal to that given +func (o *PostWebhooksClerkCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the post webhooks clerk created response +func (o *PostWebhooksClerkCreated) Code() int { + return 201 +} + +func (o *PostWebhooksClerkCreated) Error() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkCreated %+v", 201, o.Payload) +} + +func (o *PostWebhooksClerkCreated) String() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkCreated %+v", 201, o.Payload) +} + +func (o *PostWebhooksClerkCreated) GetPayload() *members_models.WebhookClerkResponse { + return o.Payload +} + +func (o *PostWebhooksClerkCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(members_models.WebhookClerkResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostWebhooksClerkUnauthorized creates a PostWebhooksClerkUnauthorized with default headers values +func NewPostWebhooksClerkUnauthorized() *PostWebhooksClerkUnauthorized { + return &PostWebhooksClerkUnauthorized{} +} + +/* +PostWebhooksClerkUnauthorized describes a response with status code 401, with default header values. + +Access Unauthorized, invalid API-KEY was used +*/ +type PostWebhooksClerkUnauthorized struct { + Payload *members_models.Error +} + +// IsSuccess returns true when this post webhooks clerk unauthorized response has a 2xx status code +func (o *PostWebhooksClerkUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post webhooks clerk unauthorized response has a 3xx status code +func (o *PostWebhooksClerkUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post webhooks clerk unauthorized response has a 4xx status code +func (o *PostWebhooksClerkUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this post webhooks clerk unauthorized response has a 5xx status code +func (o *PostWebhooksClerkUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this post webhooks clerk unauthorized response a status code equal to that given +func (o *PostWebhooksClerkUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the post webhooks clerk unauthorized response +func (o *PostWebhooksClerkUnauthorized) Code() int { + return 401 +} + +func (o *PostWebhooksClerkUnauthorized) Error() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnauthorized %+v", 401, o.Payload) +} + +func (o *PostWebhooksClerkUnauthorized) String() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnauthorized %+v", 401, o.Payload) +} + +func (o *PostWebhooksClerkUnauthorized) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostWebhooksClerkUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostWebhooksClerkForbidden creates a PostWebhooksClerkForbidden with default headers values +func NewPostWebhooksClerkForbidden() *PostWebhooksClerkForbidden { + return &PostWebhooksClerkForbidden{} +} + +/* +PostWebhooksClerkForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostWebhooksClerkForbidden struct { + AccessControlAllowOrigin string + + Payload *members_models.Error +} + +// IsSuccess returns true when this post webhooks clerk forbidden response has a 2xx status code +func (o *PostWebhooksClerkForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post webhooks clerk forbidden response has a 3xx status code +func (o *PostWebhooksClerkForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post webhooks clerk forbidden response has a 4xx status code +func (o *PostWebhooksClerkForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this post webhooks clerk forbidden response has a 5xx status code +func (o *PostWebhooksClerkForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this post webhooks clerk forbidden response a status code equal to that given +func (o *PostWebhooksClerkForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the post webhooks clerk forbidden response +func (o *PostWebhooksClerkForbidden) Code() int { + return 403 +} + +func (o *PostWebhooksClerkForbidden) Error() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkForbidden %+v", 403, o.Payload) +} + +func (o *PostWebhooksClerkForbidden) String() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkForbidden %+v", 403, o.Payload) +} + +func (o *PostWebhooksClerkForbidden) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostWebhooksClerkForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostWebhooksClerkNotFound creates a PostWebhooksClerkNotFound with default headers values +func NewPostWebhooksClerkNotFound() *PostWebhooksClerkNotFound { + return &PostWebhooksClerkNotFound{} +} + +/* +PostWebhooksClerkNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostWebhooksClerkNotFound struct { + AccessControlAllowOrigin string + + Payload *members_models.Error +} + +// IsSuccess returns true when this post webhooks clerk not found response has a 2xx status code +func (o *PostWebhooksClerkNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post webhooks clerk not found response has a 3xx status code +func (o *PostWebhooksClerkNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post webhooks clerk not found response has a 4xx status code +func (o *PostWebhooksClerkNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this post webhooks clerk not found response has a 5xx status code +func (o *PostWebhooksClerkNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this post webhooks clerk not found response a status code equal to that given +func (o *PostWebhooksClerkNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the post webhooks clerk not found response +func (o *PostWebhooksClerkNotFound) Code() int { + return 404 +} + +func (o *PostWebhooksClerkNotFound) Error() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkNotFound %+v", 404, o.Payload) +} + +func (o *PostWebhooksClerkNotFound) String() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkNotFound %+v", 404, o.Payload) +} + +func (o *PostWebhooksClerkNotFound) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostWebhooksClerkNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostWebhooksClerkUnprocessableEntity creates a PostWebhooksClerkUnprocessableEntity with default headers values +func NewPostWebhooksClerkUnprocessableEntity() *PostWebhooksClerkUnprocessableEntity { + return &PostWebhooksClerkUnprocessableEntity{} +} + +/* +PostWebhooksClerkUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostWebhooksClerkUnprocessableEntity struct { + Payload *members_models.Error +} + +// IsSuccess returns true when this post webhooks clerk unprocessable entity response has a 2xx status code +func (o *PostWebhooksClerkUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post webhooks clerk unprocessable entity response has a 3xx status code +func (o *PostWebhooksClerkUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post webhooks clerk unprocessable entity response has a 4xx status code +func (o *PostWebhooksClerkUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this post webhooks clerk unprocessable entity response has a 5xx status code +func (o *PostWebhooksClerkUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this post webhooks clerk unprocessable entity response a status code equal to that given +func (o *PostWebhooksClerkUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the post webhooks clerk unprocessable entity response +func (o *PostWebhooksClerkUnprocessableEntity) Code() int { + return 422 +} + +func (o *PostWebhooksClerkUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostWebhooksClerkUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostWebhooksClerkUnprocessableEntity) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostWebhooksClerkUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostWebhooksClerkInternalServerError creates a PostWebhooksClerkInternalServerError with default headers values +func NewPostWebhooksClerkInternalServerError() *PostWebhooksClerkInternalServerError { + return &PostWebhooksClerkInternalServerError{} +} + +/* +PostWebhooksClerkInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostWebhooksClerkInternalServerError struct { + AccessControlAllowOrigin string + + Payload *members_models.Error +} + +// IsSuccess returns true when this post webhooks clerk internal server error response has a 2xx status code +func (o *PostWebhooksClerkInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post webhooks clerk internal server error response has a 3xx status code +func (o *PostWebhooksClerkInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post webhooks clerk internal server error response has a 4xx status code +func (o *PostWebhooksClerkInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this post webhooks clerk internal server error response has a 5xx status code +func (o *PostWebhooksClerkInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this post webhooks clerk internal server error response a status code equal to that given +func (o *PostWebhooksClerkInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the post webhooks clerk internal server error response +func (o *PostWebhooksClerkInternalServerError) Code() int { + return 500 +} + +func (o *PostWebhooksClerkInternalServerError) Error() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkInternalServerError %+v", 500, o.Payload) +} + +func (o *PostWebhooksClerkInternalServerError) String() string { + return fmt.Sprintf("[POST /webhooks/clerk][%d] postWebhooksClerkInternalServerError %+v", 500, o.Payload) +} + +func (o *PostWebhooksClerkInternalServerError) GetPayload() *members_models.Error { + return o.Payload +} + +func (o *PostWebhooksClerkInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(members_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/members/members_client/webhooks/webhooks_client.go b/api/members/members_client/webhooks/webhooks_client.go new file mode 100644 index 0000000..6033c02 --- /dev/null +++ b/api/members/members_client/webhooks/webhooks_client.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new webhooks API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for webhooks API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PostWebhooksClerk(params *PostWebhooksClerkParams, opts ...ClientOption) (*PostWebhooksClerkCreated, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +PostWebhooksClerk clerks webhook + +Clerk webhook +*/ +func (a *Client) PostWebhooksClerk(params *PostWebhooksClerkParams, opts ...ClientOption) (*PostWebhooksClerkCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostWebhooksClerkParams() + } + op := &runtime.ClientOperation{ + ID: "postWebhooksClerk", + Method: "POST", + PathPattern: "/webhooks/clerk", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PostWebhooksClerkReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PostWebhooksClerkCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for postWebhooksClerk: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/members/members_models/clerk_user.go b/api/members/members_models/clerk_user.go new file mode 100644 index 0000000..67db38c --- /dev/null +++ b/api/members/members_models/clerk_user.go @@ -0,0 +1,270 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package members_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClerkUser Clerk user object +// +// swagger:model ClerkUser +type ClerkUser struct { + + // If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + // You must provide the backup codes in plain format or the corresponding bcrypt digest. + BackupCodes []string `json:"backup_codes"` + + // A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + CreatedAt string `json:"created_at,omitempty"` + + // Email addresses to add to the user. + // Must be unique across your instance. + // The first email address will be set as the user's primary email address. + EmailAddress []string `json:"email_address"` + + // The ID of the user as used in your external systems or your previous authentication solution. + // Must be unique across your instance. + ExternalID string `json:"external_id,omitempty"` + + // The first name to assign to the user + FirstName string `json:"first_name,omitempty"` + + // The last name to assign to the user + LastName string `json:"last_name,omitempty"` + + // The plaintext password to give the user. + // Must be at least 8 characters long, and can not be in any list of hacked passwords. + Password string `json:"password,omitempty"` + + // In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + // The digests should be generated with one of the supported algorithms. + // The hashing algorithm can be specified using the `password_hasher` property. + PasswordDigest string `json:"password_digest,omitempty"` + + // The hashing algorithm that was used to generate the password digest. + // The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), md5, pbkdf2_sha256, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/) and 2 [argon2](https://argon2.online/) variants, argon2i and argon2id. + // Each of the above expects the incoming digest to be of a particular format. + // + // More specifically: + // + // **bcrypt:** The digest should be of the following form: + // + // `$$$` + // + // **md5:** The digest should follow the regular form e.g.: + // + // `5f4dcc3b5aa765d61d8327deb882cf99` + // + // **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + // + // `pbkdf2_sha256$$$` + // + // Note: Both the salt and the hash are expected to be base64-encoded. + // + // **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + // + // `pbkdf2_sha256$$$` + // + // Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + // + // **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + // 1. uses sha1 instead of sha256 + // 2. accepts the hash as a hex-encoded string + // + // The format is the following: + // + // `pbkdf2_sha1$$$` + // + // + // **scrypt_firebase:** The Firebase-specific variant of scrypt. + // The value is expected to have 6 segments separated by the $ character and include the following information: + // + // _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + // _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + // _signer key:_ The base64 encoded signer key. + // _salt separator:_ The base64 encoded salt separator. + // _rounds:_ The number of rounds the algorithm needs to run. + // _memory cost:_ The cost of the algorithm run + // + // The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + // The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + // + // Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + // + // `$$$$$` + // + // **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + // + // _version (v):_ The argon version, version 19 is assumed + // _memory (m):_ The memory used by the algorithm (in kibibytes) + // _iterations (t):_ The number of iterations to perform + // _parallelism (p):_ The number of threads to use + // + // Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + // The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + // The final part is the actual digest. + // + // `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + // + // **argon2id:** See the previous algorithm for an explanation of the formatting. + // + // For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + // + // `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + // + // If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + // Enum: [bcrypt md5 pbkdf2_sha256 pbkdf2_sha256_django pbkdf2_sha1 scrypt_firebase argon2i argon2id] + PasswordHasher string `json:"password_hasher,omitempty"` + + // Phone numbers to add to the user. + // Must be unique across your instance. + // The first phone number will be set as the user's primary phone number. + PhoneNumber []string `json:"phone_number"` + + // Metadata saved on the user, that is only visible to your Backend API + PrivateMetadata interface{} `json:"private_metadata,omitempty"` + + // Metadata saved on the user, that is visible to both your Frontend and Backend APIs + PublicMetadata interface{} `json:"public_metadata,omitempty"` + + // When set to `true` all password checks are skipped. + // It is recommended to use this method only when migrating plaintext passwords to Clerk. + // Upon migration the user base should be prompted to pick stronger password. + SkipPasswordChecks bool `json:"skip_password_checks,omitempty"` + + // When set to `true`, `password` is not required anymore when creating the user and can be omitted. + // This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + // Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + SkipPasswordRequirement bool `json:"skip_password_requirement,omitempty"` + + // In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + // Please note that currently the supported options are: + // * Period: 30 seconds + // * Code length: 6 digits + // * Algorithm: SHA1 + TotpSecret string `json:"totp_secret,omitempty"` + + // Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + // Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + UnsafeMetadata interface{} `json:"unsafe_metadata,omitempty"` + + // The username to give to the user. + // It must be unique across your instance. + Username string `json:"username,omitempty"` + + // Web3 wallets to add to the user. + // Must be unique across your instance. + // The first wallet will be set as the user's primary wallet. + Web3Wallet []string `json:"web3_wallet"` +} + +// Validate validates this clerk user +func (m *ClerkUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePasswordHasher(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var clerkUserTypePasswordHasherPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["bcrypt","md5","pbkdf2_sha256","pbkdf2_sha256_django","pbkdf2_sha1","scrypt_firebase","argon2i","argon2id"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + clerkUserTypePasswordHasherPropEnum = append(clerkUserTypePasswordHasherPropEnum, v) + } +} + +const ( + + // ClerkUserPasswordHasherBcrypt captures enum value "bcrypt" + ClerkUserPasswordHasherBcrypt string = "bcrypt" + + // ClerkUserPasswordHasherMd5 captures enum value "md5" + ClerkUserPasswordHasherMd5 string = "md5" + + // ClerkUserPasswordHasherPbkdf2Sha256 captures enum value "pbkdf2_sha256" + ClerkUserPasswordHasherPbkdf2Sha256 string = "pbkdf2_sha256" + + // ClerkUserPasswordHasherPbkdf2Sha256Django captures enum value "pbkdf2_sha256_django" + ClerkUserPasswordHasherPbkdf2Sha256Django string = "pbkdf2_sha256_django" + + // ClerkUserPasswordHasherPbkdf2Sha1 captures enum value "pbkdf2_sha1" + ClerkUserPasswordHasherPbkdf2Sha1 string = "pbkdf2_sha1" + + // ClerkUserPasswordHasherScryptFirebase captures enum value "scrypt_firebase" + ClerkUserPasswordHasherScryptFirebase string = "scrypt_firebase" + + // ClerkUserPasswordHasherArgon2i captures enum value "argon2i" + ClerkUserPasswordHasherArgon2i string = "argon2i" + + // ClerkUserPasswordHasherArgon2id captures enum value "argon2id" + ClerkUserPasswordHasherArgon2id string = "argon2id" +) + +// prop value enum +func (m *ClerkUser) validatePasswordHasherEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, clerkUserTypePasswordHasherPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ClerkUser) validatePasswordHasher(formats strfmt.Registry) error { + if swag.IsZero(m.PasswordHasher) { // not required + return nil + } + + // value enum + if err := m.validatePasswordHasherEnum("password_hasher", "body", m.PasswordHasher); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this clerk user based on context it is used +func (m *ClerkUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ClerkUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClerkUser) UnmarshalBinary(b []byte) error { + var res ClerkUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/members/members_models/user.go b/api/members/members_models/user.go index cbb6221..2cdc069 100644 --- a/api/members/members_models/user.go +++ b/api/members/members_models/user.go @@ -170,6 +170,9 @@ type User struct { // The time day starts StartOfDay string `json:"StartOfDay,omitempty"` + // Onboarding Status + Status string `json:"Status,omitempty"` + // Account TaxnexusAccount string `json:"TaxnexusAccount,omitempty"` diff --git a/api/members/members_models/webhook_clerk_request.go b/api/members/members_models/webhook_clerk_request.go new file mode 100644 index 0000000..92720cc --- /dev/null +++ b/api/members/members_models/webhook_clerk_request.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package members_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// WebhookClerkRequest Clerk webhook object +// +// swagger:model WebhookClerkRequest +type WebhookClerkRequest struct { + + // data + Data interface{} `json:"data,omitempty"` + + // object + Object string `json:"object,omitempty"` + + // Clerk Name + Type string `json:"type,omitempty"` +} + +// Validate validates this webhook clerk request +func (m *WebhookClerkRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this webhook clerk request based on context it is used +func (m *WebhookClerkRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WebhookClerkRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WebhookClerkRequest) UnmarshalBinary(b []byte) error { + var res WebhookClerkRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/members/members_models/webhook_clerk_response.go b/api/members/members_models/webhook_clerk_response.go new file mode 100644 index 0000000..00cfa0d --- /dev/null +++ b/api/members/members_models/webhook_clerk_response.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package members_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// WebhookClerkResponse Clerk webhook object +// +// swagger:model WebhookClerkResponse +type WebhookClerkResponse struct { + + // data + Data interface{} `json:"data,omitempty"` + + // object + Object string `json:"object,omitempty"` + + // Clerk Name + Type string `json:"type,omitempty"` +} + +// Validate validates this webhook clerk response +func (m *WebhookClerkResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this webhook clerk response based on context it is used +func (m *WebhookClerkResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WebhookClerkResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WebhookClerkResponse) UnmarshalBinary(b []byte) error { + var res WebhookClerkResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/plex/plex_client/companies/get_companies_parameters.go b/api/plex/plex_client/companies/get_companies_parameters.go index a0510f2..fd443eb 100644 --- a/api/plex/plex_client/companies/get_companies_parameters.go +++ b/api/plex/plex_client/companies/get_companies_parameters.go @@ -71,6 +71,12 @@ type GetCompaniesParams struct { */ CompanyID *string + /* Slug. + + The slug of the item to retrieve + */ + Slug *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -135,6 +141,17 @@ func (o *GetCompaniesParams) SetCompanyID(companyID *string) { o.CompanyID = companyID } +// WithSlug adds the slug to the get companies params +func (o *GetCompaniesParams) WithSlug(slug *string) *GetCompaniesParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the get companies params +func (o *GetCompaniesParams) SetSlug(slug *string) { + o.Slug = slug +} + // WriteToRequest writes these params to a swagger request func (o *GetCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -160,6 +177,23 @@ func (o *GetCompaniesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } } + if o.Slug != nil { + + // query param slug + var qrSlug string + + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/api/research/research_client/company_categories/company_categories_client.go b/api/research/research_client/company_categories/company_categories_client.go new file mode 100644 index 0000000..fb46c01 --- /dev/null +++ b/api/research/research_client/company_categories/company_categories_client.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package company_categories + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new company categories API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for company categories API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetCompanyCategories(params *GetCompanyCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyCategoriesOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetCompanyCategories gets a list of company categories + +Return all or a single company category fully hydrated object +*/ +func (a *Client) GetCompanyCategories(params *GetCompanyCategoriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyCategoriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCompanyCategoriesParams() + } + op := &runtime.ClientOperation{ + ID: "getCompanyCategories", + Method: "GET", + PathPattern: "/companycategories", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetCompanyCategoriesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetCompanyCategoriesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getCompanyCategories: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/research/research_client/company_categories/get_company_categories_parameters.go b/api/research/research_client/company_categories/get_company_categories_parameters.go new file mode 100644 index 0000000..b9d6a36 --- /dev/null +++ b/api/research/research_client/company_categories/get_company_categories_parameters.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package company_categories + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetCompanyCategoriesParams creates a new GetCompanyCategoriesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCompanyCategoriesParams() *GetCompanyCategoriesParams { + return &GetCompanyCategoriesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCompanyCategoriesParamsWithTimeout creates a new GetCompanyCategoriesParams object +// with the ability to set a timeout on a request. +func NewGetCompanyCategoriesParamsWithTimeout(timeout time.Duration) *GetCompanyCategoriesParams { + return &GetCompanyCategoriesParams{ + timeout: timeout, + } +} + +// NewGetCompanyCategoriesParamsWithContext creates a new GetCompanyCategoriesParams object +// with the ability to set a context for a request. +func NewGetCompanyCategoriesParamsWithContext(ctx context.Context) *GetCompanyCategoriesParams { + return &GetCompanyCategoriesParams{ + Context: ctx, + } +} + +// NewGetCompanyCategoriesParamsWithHTTPClient creates a new GetCompanyCategoriesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCompanyCategoriesParamsWithHTTPClient(client *http.Client) *GetCompanyCategoriesParams { + return &GetCompanyCategoriesParams{ + HTTPClient: client, + } +} + +/* +GetCompanyCategoriesParams contains all the parameters to send to the API endpoint + + for the get company categories operation. + + Typically these are written to a http.Request. +*/ +type GetCompanyCategoriesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get company categories params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompanyCategoriesParams) WithDefaults() *GetCompanyCategoriesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get company categories params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCompanyCategoriesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get company categories params +func (o *GetCompanyCategoriesParams) WithTimeout(timeout time.Duration) *GetCompanyCategoriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get company categories params +func (o *GetCompanyCategoriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get company categories params +func (o *GetCompanyCategoriesParams) WithContext(ctx context.Context) *GetCompanyCategoriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get company categories params +func (o *GetCompanyCategoriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get company categories params +func (o *GetCompanyCategoriesParams) WithHTTPClient(client *http.Client) *GetCompanyCategoriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get company categories params +func (o *GetCompanyCategoriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCompanyCategoriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/research/research_client/company_categories/get_company_categories_responses.go b/api/research/research_client/company_categories/get_company_categories_responses.go new file mode 100644 index 0000000..66868cf --- /dev/null +++ b/api/research/research_client/company_categories/get_company_categories_responses.go @@ -0,0 +1,522 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package company_categories + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/research/research_models" +) + +// GetCompanyCategoriesReader is a Reader for the GetCompanyCategories structure. +type GetCompanyCategoriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCompanyCategoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCompanyCategoriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetCompanyCategoriesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCompanyCategoriesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetCompanyCategoriesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetCompanyCategoriesUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCompanyCategoriesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCompanyCategoriesOK creates a GetCompanyCategoriesOK with default headers values +func NewGetCompanyCategoriesOK() *GetCompanyCategoriesOK { + return &GetCompanyCategoriesOK{} +} + +/* +GetCompanyCategoriesOK describes a response with status code 200, with default header values. + +The SalesforceDevops.net CompanyCategory Object +*/ +type GetCompanyCategoriesOK struct { + Payload *research_models.CompanyCategoryResponse +} + +// IsSuccess returns true when this get company categories o k response has a 2xx status code +func (o *GetCompanyCategoriesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get company categories o k response has a 3xx status code +func (o *GetCompanyCategoriesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company categories o k response has a 4xx status code +func (o *GetCompanyCategoriesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get company categories o k response has a 5xx status code +func (o *GetCompanyCategoriesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get company categories o k response a status code equal to that given +func (o *GetCompanyCategoriesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get company categories o k response +func (o *GetCompanyCategoriesOK) Code() int { + return 200 +} + +func (o *GetCompanyCategoriesOK) Error() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesOK %+v", 200, o.Payload) +} + +func (o *GetCompanyCategoriesOK) String() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesOK %+v", 200, o.Payload) +} + +func (o *GetCompanyCategoriesOK) GetPayload() *research_models.CompanyCategoryResponse { + return o.Payload +} + +func (o *GetCompanyCategoriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(research_models.CompanyCategoryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompanyCategoriesUnauthorized creates a GetCompanyCategoriesUnauthorized with default headers values +func NewGetCompanyCategoriesUnauthorized() *GetCompanyCategoriesUnauthorized { + return &GetCompanyCategoriesUnauthorized{} +} + +/* +GetCompanyCategoriesUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type GetCompanyCategoriesUnauthorized struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company categories unauthorized response has a 2xx status code +func (o *GetCompanyCategoriesUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company categories unauthorized response has a 3xx status code +func (o *GetCompanyCategoriesUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company categories unauthorized response has a 4xx status code +func (o *GetCompanyCategoriesUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company categories unauthorized response has a 5xx status code +func (o *GetCompanyCategoriesUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get company categories unauthorized response a status code equal to that given +func (o *GetCompanyCategoriesUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get company categories unauthorized response +func (o *GetCompanyCategoriesUnauthorized) Code() int { + return 401 +} + +func (o *GetCompanyCategoriesUnauthorized) Error() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCompanyCategoriesUnauthorized) String() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesUnauthorized %+v", 401, o.Payload) +} + +func (o *GetCompanyCategoriesUnauthorized) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyCategoriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompanyCategoriesForbidden creates a GetCompanyCategoriesForbidden with default headers values +func NewGetCompanyCategoriesForbidden() *GetCompanyCategoriesForbidden { + return &GetCompanyCategoriesForbidden{} +} + +/* +GetCompanyCategoriesForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type GetCompanyCategoriesForbidden struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company categories forbidden response has a 2xx status code +func (o *GetCompanyCategoriesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company categories forbidden response has a 3xx status code +func (o *GetCompanyCategoriesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company categories forbidden response has a 4xx status code +func (o *GetCompanyCategoriesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company categories forbidden response has a 5xx status code +func (o *GetCompanyCategoriesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get company categories forbidden response a status code equal to that given +func (o *GetCompanyCategoriesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get company categories forbidden response +func (o *GetCompanyCategoriesForbidden) Code() int { + return 403 +} + +func (o *GetCompanyCategoriesForbidden) Error() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesForbidden %+v", 403, o.Payload) +} + +func (o *GetCompanyCategoriesForbidden) String() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesForbidden %+v", 403, o.Payload) +} + +func (o *GetCompanyCategoriesForbidden) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyCategoriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompanyCategoriesNotFound creates a GetCompanyCategoriesNotFound with default headers values +func NewGetCompanyCategoriesNotFound() *GetCompanyCategoriesNotFound { + return &GetCompanyCategoriesNotFound{} +} + +/* +GetCompanyCategoriesNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type GetCompanyCategoriesNotFound struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company categories not found response has a 2xx status code +func (o *GetCompanyCategoriesNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company categories not found response has a 3xx status code +func (o *GetCompanyCategoriesNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company categories not found response has a 4xx status code +func (o *GetCompanyCategoriesNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company categories not found response has a 5xx status code +func (o *GetCompanyCategoriesNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get company categories not found response a status code equal to that given +func (o *GetCompanyCategoriesNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get company categories not found response +func (o *GetCompanyCategoriesNotFound) Code() int { + return 404 +} + +func (o *GetCompanyCategoriesNotFound) Error() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesNotFound %+v", 404, o.Payload) +} + +func (o *GetCompanyCategoriesNotFound) String() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesNotFound %+v", 404, o.Payload) +} + +func (o *GetCompanyCategoriesNotFound) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyCategoriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompanyCategoriesUnprocessableEntity creates a GetCompanyCategoriesUnprocessableEntity with default headers values +func NewGetCompanyCategoriesUnprocessableEntity() *GetCompanyCategoriesUnprocessableEntity { + return &GetCompanyCategoriesUnprocessableEntity{} +} + +/* +GetCompanyCategoriesUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type GetCompanyCategoriesUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company categories unprocessable entity response has a 2xx status code +func (o *GetCompanyCategoriesUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company categories unprocessable entity response has a 3xx status code +func (o *GetCompanyCategoriesUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company categories unprocessable entity response has a 4xx status code +func (o *GetCompanyCategoriesUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this get company categories unprocessable entity response has a 5xx status code +func (o *GetCompanyCategoriesUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this get company categories unprocessable entity response a status code equal to that given +func (o *GetCompanyCategoriesUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the get company categories unprocessable entity response +func (o *GetCompanyCategoriesUnprocessableEntity) Code() int { + return 422 +} + +func (o *GetCompanyCategoriesUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCompanyCategoriesUnprocessableEntity) String() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetCompanyCategoriesUnprocessableEntity) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyCategoriesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCompanyCategoriesInternalServerError creates a GetCompanyCategoriesInternalServerError with default headers values +func NewGetCompanyCategoriesInternalServerError() *GetCompanyCategoriesInternalServerError { + return &GetCompanyCategoriesInternalServerError{} +} + +/* +GetCompanyCategoriesInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type GetCompanyCategoriesInternalServerError struct { + AccessControlAllowOrigin string + + Payload *research_models.Error +} + +// IsSuccess returns true when this get company categories internal server error response has a 2xx status code +func (o *GetCompanyCategoriesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get company categories internal server error response has a 3xx status code +func (o *GetCompanyCategoriesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get company categories internal server error response has a 4xx status code +func (o *GetCompanyCategoriesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get company categories internal server error response has a 5xx status code +func (o *GetCompanyCategoriesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get company categories internal server error response a status code equal to that given +func (o *GetCompanyCategoriesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get company categories internal server error response +func (o *GetCompanyCategoriesInternalServerError) Code() int { + return 500 +} + +func (o *GetCompanyCategoriesInternalServerError) Error() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCompanyCategoriesInternalServerError) String() string { + return fmt.Sprintf("[GET /companycategories][%d] getCompanyCategoriesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetCompanyCategoriesInternalServerError) GetPayload() *research_models.Error { + return o.Payload +} + +func (o *GetCompanyCategoriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(research_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/research/research_client/research_client.go b/api/research/research_client/research_client.go index e744dc4..6497b52 100644 --- a/api/research/research_client/research_client.go +++ b/api/research/research_client/research_client.go @@ -14,6 +14,7 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "code.tnxs.net/vernonkeenan/lib/api/research/research_client/company_categories" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/company_products" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/factors" "code.tnxs.net/vernonkeenan/lib/api/research/research_client/financial_statements" @@ -66,6 +67,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Research { cli := new(Research) cli.Transport = transport + cli.CompanyCategories = company_categories.New(transport, formats) cli.CompanyProducts = company_products.New(transport, formats) cli.Factors = factors.New(transport, formats) cli.FinancialStatements = financial_statements.New(transport, formats) @@ -118,6 +120,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { // Research is a client for research type Research struct { + CompanyCategories company_categories.ClientService + CompanyProducts company_products.ClientService Factors factors.ClientService @@ -140,6 +144,7 @@ type Research struct { // SetTransport changes the transport on the client and all its subresources func (c *Research) SetTransport(transport runtime.ClientTransport) { c.Transport = transport + c.CompanyCategories.SetTransport(transport) c.CompanyProducts.SetTransport(transport) c.Factors.SetTransport(transport) c.FinancialStatements.SetTransport(transport) diff --git a/api/research/research_models/company_category.go b/api/research/research_models/company_category.go new file mode 100644 index 0000000..1881bd1 --- /dev/null +++ b/api/research/research_models/company_category.go @@ -0,0 +1,57 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CompanyCategory company category +// +// swagger:model CompanyCategory +type CompanyCategory struct { + + // The Type of Cloud Company + CloudType string `json:"CloudType,omitempty"` + + // The number of companies + Count float64 `json:"Count,omitempty"` +} + +// Validate validates this company category +func (m *CompanyCategory) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this company category based on context it is used +func (m *CompanyCategory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyCategory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyCategory) UnmarshalBinary(b []byte) error { + var res CompanyCategory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/research/research_models/company_category_response.go b/api/research/research_models/company_category_response.go new file mode 100644 index 0000000..54afd42 --- /dev/null +++ b/api/research/research_models/company_category_response.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package research_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CompanyCategoryResponse An array of CompanyCategory objects produced in response to a request +// +// swagger:model CompanyCategoryResponse +type CompanyCategoryResponse struct { + + // data + Data []*CompanyCategory `json:"Data"` + + // meta + Meta *ResponseMeta `json:"Meta,omitempty"` +} + +// Validate validates this company category response +func (m *CompanyCategoryResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMeta(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyCategoryResponse) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CompanyCategoryResponse) validateMeta(formats strfmt.Registry) error { + if swag.IsZero(m.Meta) { // not required + return nil + } + + if m.Meta != nil { + if err := m.Meta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// ContextValidate validate this company category response based on the context it is used +func (m *CompanyCategoryResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CompanyCategoryResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CompanyCategoryResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.Meta != nil { + if err := m.Meta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Meta") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CompanyCategoryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompanyCategoryResponse) UnmarshalBinary(b []byte) error { + var res CompanyCategoryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/sfgate/sfgate_client/users/post_user_parameters.go b/api/sfgate/sfgate_client/users/post_user_parameters.go deleted file mode 100644 index 562e309..0000000 --- a/api/sfgate/sfgate_client/users/post_user_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// (c) 2012-2020 by Taxnexus, Inc. -// All rights reserved worldwide. -// Proprietary product; unlicensed use is not allowed - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" -) - -// NewPostUserParams creates a new PostUserParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPostUserParams() *PostUserParams { - return &PostUserParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPostUserParamsWithTimeout creates a new PostUserParams object -// with the ability to set a timeout on a request. -func NewPostUserParamsWithTimeout(timeout time.Duration) *PostUserParams { - return &PostUserParams{ - timeout: timeout, - } -} - -// NewPostUserParamsWithContext creates a new PostUserParams object -// with the ability to set a context for a request. -func NewPostUserParamsWithContext(ctx context.Context) *PostUserParams { - return &PostUserParams{ - Context: ctx, - } -} - -// NewPostUserParamsWithHTTPClient creates a new PostUserParams object -// with the ability to set a custom HTTPClient for a request. -func NewPostUserParamsWithHTTPClient(client *http.Client) *PostUserParams { - return &PostUserParams{ - HTTPClient: client, - } -} - -/* -PostUserParams contains all the parameters to send to the API endpoint - - for the post user operation. - - Typically these are written to a http.Request. -*/ -type PostUserParams struct { - - /* UserRequest. - - A single new user record - */ - UserRequest *sfgate_models.UserRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the post user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PostUserParams) WithDefaults() *PostUserParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the post user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PostUserParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the post user params -func (o *PostUserParams) WithTimeout(timeout time.Duration) *PostUserParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the post user params -func (o *PostUserParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the post user params -func (o *PostUserParams) WithContext(ctx context.Context) *PostUserParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the post user params -func (o *PostUserParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the post user params -func (o *PostUserParams) WithHTTPClient(client *http.Client) *PostUserParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the post user params -func (o *PostUserParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithUserRequest adds the userRequest to the post user params -func (o *PostUserParams) WithUserRequest(userRequest *sfgate_models.UserRequest) *PostUserParams { - o.SetUserRequest(userRequest) - return o -} - -// SetUserRequest adds the userRequest to the post user params -func (o *PostUserParams) SetUserRequest(userRequest *sfgate_models.UserRequest) { - o.UserRequest = userRequest -} - -// WriteToRequest writes these params to a swagger request -func (o *PostUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.UserRequest != nil { - if err := r.SetBodyParam(o.UserRequest); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/sfgate/sfgate_client/users/post_user_responses.go b/api/sfgate/sfgate_client/users/post_user_responses.go deleted file mode 100644 index a612aef..0000000 --- a/api/sfgate/sfgate_client/users/post_user_responses.go +++ /dev/null @@ -1,522 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// (c) 2012-2020 by Taxnexus, Inc. -// All rights reserved worldwide. -// Proprietary product; unlicensed use is not allowed - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" -) - -// PostUserReader is a Reader for the PostUser structure. -type PostUserReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PostUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPostUserOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewPostUserUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPostUserForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPostUserNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPostUserUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPostUserInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPostUserOK creates a PostUserOK with default headers values -func NewPostUserOK() *PostUserOK { - return &PostUserOK{} -} - -/* -PostUserOK describes a response with status code 200, with default header values. - -Response from Salesforce -*/ -type PostUserOK struct { - Payload *sfgate_models.SalesforcePostResponse -} - -// IsSuccess returns true when this post user o k response has a 2xx status code -func (o *PostUserOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this post user o k response has a 3xx status code -func (o *PostUserOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this post user o k response has a 4xx status code -func (o *PostUserOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this post user o k response has a 5xx status code -func (o *PostUserOK) IsServerError() bool { - return false -} - -// IsCode returns true when this post user o k response a status code equal to that given -func (o *PostUserOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the post user o k response -func (o *PostUserOK) Code() int { - return 200 -} - -func (o *PostUserOK) Error() string { - return fmt.Sprintf("[POST /users][%d] postUserOK %+v", 200, o.Payload) -} - -func (o *PostUserOK) String() string { - return fmt.Sprintf("[POST /users][%d] postUserOK %+v", 200, o.Payload) -} - -func (o *PostUserOK) GetPayload() *sfgate_models.SalesforcePostResponse { - return o.Payload -} - -func (o *PostUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(sfgate_models.SalesforcePostResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPostUserUnauthorized creates a PostUserUnauthorized with default headers values -func NewPostUserUnauthorized() *PostUserUnauthorized { - return &PostUserUnauthorized{} -} - -/* -PostUserUnauthorized describes a response with status code 401, with default header values. - -Access unauthorized, invalid API-KEY was used -*/ -type PostUserUnauthorized struct { - AccessControlAllowOrigin string - - Payload *sfgate_models.Error -} - -// IsSuccess returns true when this post user unauthorized response has a 2xx status code -func (o *PostUserUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this post user unauthorized response has a 3xx status code -func (o *PostUserUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this post user unauthorized response has a 4xx status code -func (o *PostUserUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this post user unauthorized response has a 5xx status code -func (o *PostUserUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this post user unauthorized response a status code equal to that given -func (o *PostUserUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the post user unauthorized response -func (o *PostUserUnauthorized) Code() int { - return 401 -} - -func (o *PostUserUnauthorized) Error() string { - return fmt.Sprintf("[POST /users][%d] postUserUnauthorized %+v", 401, o.Payload) -} - -func (o *PostUserUnauthorized) String() string { - return fmt.Sprintf("[POST /users][%d] postUserUnauthorized %+v", 401, o.Payload) -} - -func (o *PostUserUnauthorized) GetPayload() *sfgate_models.Error { - return o.Payload -} - -func (o *PostUserUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(sfgate_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPostUserForbidden creates a PostUserForbidden with default headers values -func NewPostUserForbidden() *PostUserForbidden { - return &PostUserForbidden{} -} - -/* -PostUserForbidden describes a response with status code 403, with default header values. - -Access forbidden, account lacks access -*/ -type PostUserForbidden struct { - AccessControlAllowOrigin string - - Payload *sfgate_models.Error -} - -// IsSuccess returns true when this post user forbidden response has a 2xx status code -func (o *PostUserForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this post user forbidden response has a 3xx status code -func (o *PostUserForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this post user forbidden response has a 4xx status code -func (o *PostUserForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this post user forbidden response has a 5xx status code -func (o *PostUserForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this post user forbidden response a status code equal to that given -func (o *PostUserForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the post user forbidden response -func (o *PostUserForbidden) Code() int { - return 403 -} - -func (o *PostUserForbidden) Error() string { - return fmt.Sprintf("[POST /users][%d] postUserForbidden %+v", 403, o.Payload) -} - -func (o *PostUserForbidden) String() string { - return fmt.Sprintf("[POST /users][%d] postUserForbidden %+v", 403, o.Payload) -} - -func (o *PostUserForbidden) GetPayload() *sfgate_models.Error { - return o.Payload -} - -func (o *PostUserForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(sfgate_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPostUserNotFound creates a PostUserNotFound with default headers values -func NewPostUserNotFound() *PostUserNotFound { - return &PostUserNotFound{} -} - -/* -PostUserNotFound describes a response with status code 404, with default header values. - -Resource was not found -*/ -type PostUserNotFound struct { - AccessControlAllowOrigin string - - Payload *sfgate_models.Error -} - -// IsSuccess returns true when this post user not found response has a 2xx status code -func (o *PostUserNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this post user not found response has a 3xx status code -func (o *PostUserNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this post user not found response has a 4xx status code -func (o *PostUserNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this post user not found response has a 5xx status code -func (o *PostUserNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this post user not found response a status code equal to that given -func (o *PostUserNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the post user not found response -func (o *PostUserNotFound) Code() int { - return 404 -} - -func (o *PostUserNotFound) Error() string { - return fmt.Sprintf("[POST /users][%d] postUserNotFound %+v", 404, o.Payload) -} - -func (o *PostUserNotFound) String() string { - return fmt.Sprintf("[POST /users][%d] postUserNotFound %+v", 404, o.Payload) -} - -func (o *PostUserNotFound) GetPayload() *sfgate_models.Error { - return o.Payload -} - -func (o *PostUserNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(sfgate_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPostUserUnprocessableEntity creates a PostUserUnprocessableEntity with default headers values -func NewPostUserUnprocessableEntity() *PostUserUnprocessableEntity { - return &PostUserUnprocessableEntity{} -} - -/* -PostUserUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity, likely a bad parameter -*/ -type PostUserUnprocessableEntity struct { - AccessControlAllowOrigin string - - Payload *sfgate_models.Error -} - -// IsSuccess returns true when this post user unprocessable entity response has a 2xx status code -func (o *PostUserUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this post user unprocessable entity response has a 3xx status code -func (o *PostUserUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this post user unprocessable entity response has a 4xx status code -func (o *PostUserUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this post user unprocessable entity response has a 5xx status code -func (o *PostUserUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this post user unprocessable entity response a status code equal to that given -func (o *PostUserUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the post user unprocessable entity response -func (o *PostUserUnprocessableEntity) Code() int { - return 422 -} - -func (o *PostUserUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /users][%d] postUserUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *PostUserUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /users][%d] postUserUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *PostUserUnprocessableEntity) GetPayload() *sfgate_models.Error { - return o.Payload -} - -func (o *PostUserUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(sfgate_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPostUserInternalServerError creates a PostUserInternalServerError with default headers values -func NewPostUserInternalServerError() *PostUserInternalServerError { - return &PostUserInternalServerError{} -} - -/* -PostUserInternalServerError describes a response with status code 500, with default header values. - -Server Internal Error -*/ -type PostUserInternalServerError struct { - AccessControlAllowOrigin string - - Payload *sfgate_models.Error -} - -// IsSuccess returns true when this post user internal server error response has a 2xx status code -func (o *PostUserInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this post user internal server error response has a 3xx status code -func (o *PostUserInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this post user internal server error response has a 4xx status code -func (o *PostUserInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this post user internal server error response has a 5xx status code -func (o *PostUserInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this post user internal server error response a status code equal to that given -func (o *PostUserInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the post user internal server error response -func (o *PostUserInternalServerError) Code() int { - return 500 -} - -func (o *PostUserInternalServerError) Error() string { - return fmt.Sprintf("[POST /users][%d] postUserInternalServerError %+v", 500, o.Payload) -} - -func (o *PostUserInternalServerError) String() string { - return fmt.Sprintf("[POST /users][%d] postUserInternalServerError %+v", 500, o.Payload) -} - -func (o *PostUserInternalServerError) GetPayload() *sfgate_models.Error { - return o.Payload -} - -func (o *PostUserInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Access-Control-Allow-Origin - hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") - - if hdrAccessControlAllowOrigin != "" { - o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin - } - - o.Payload = new(sfgate_models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/api/sfgate/sfgate_client/users/post_users_parameters.go b/api/sfgate/sfgate_client/users/post_users_parameters.go new file mode 100644 index 0000000..8c74ff5 --- /dev/null +++ b/api/sfgate/sfgate_client/users/post_users_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// NewPostUsersParams creates a new PostUsersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPostUsersParams() *PostUsersParams { + return &PostUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostUsersParamsWithTimeout creates a new PostUsersParams object +// with the ability to set a timeout on a request. +func NewPostUsersParamsWithTimeout(timeout time.Duration) *PostUsersParams { + return &PostUsersParams{ + timeout: timeout, + } +} + +// NewPostUsersParamsWithContext creates a new PostUsersParams object +// with the ability to set a context for a request. +func NewPostUsersParamsWithContext(ctx context.Context) *PostUsersParams { + return &PostUsersParams{ + Context: ctx, + } +} + +// NewPostUsersParamsWithHTTPClient creates a new PostUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostUsersParamsWithHTTPClient(client *http.Client) *PostUsersParams { + return &PostUsersParams{ + HTTPClient: client, + } +} + +/* +PostUsersParams contains all the parameters to send to the API endpoint + + for the post users operation. + + Typically these are written to a http.Request. +*/ +type PostUsersParams struct { + + /* UserRequest. + + A single new user record + */ + UserRequest *sfgate_models.UserRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsersParams) WithDefaults() *PostUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post users params +func (o *PostUsersParams) WithTimeout(timeout time.Duration) *PostUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post users params +func (o *PostUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post users params +func (o *PostUsersParams) WithContext(ctx context.Context) *PostUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post users params +func (o *PostUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post users params +func (o *PostUsersParams) WithHTTPClient(client *http.Client) *PostUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post users params +func (o *PostUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUserRequest adds the userRequest to the post users params +func (o *PostUsersParams) WithUserRequest(userRequest *sfgate_models.UserRequest) *PostUsersParams { + o.SetUserRequest(userRequest) + return o +} + +// SetUserRequest adds the userRequest to the post users params +func (o *PostUsersParams) SetUserRequest(userRequest *sfgate_models.UserRequest) { + o.UserRequest = userRequest +} + +// WriteToRequest writes these params to a swagger request +func (o *PostUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UserRequest != nil { + if err := r.SetBodyParam(o.UserRequest); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/sfgate/sfgate_client/users/post_users_responses.go b/api/sfgate/sfgate_client/users/post_users_responses.go new file mode 100644 index 0000000..5a3b62c --- /dev/null +++ b/api/sfgate/sfgate_client/users/post_users_responses.go @@ -0,0 +1,522 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// (c) 2012-2020 by Taxnexus, Inc. +// All rights reserved worldwide. +// Proprietary product; unlicensed use is not allowed + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" +) + +// PostUsersReader is a Reader for the PostUsers structure. +type PostUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPostUsersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostUsersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPostUsersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPostUsersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostUsersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostUsersOK creates a PostUsersOK with default headers values +func NewPostUsersOK() *PostUsersOK { + return &PostUsersOK{} +} + +/* +PostUsersOK describes a response with status code 200, with default header values. + +Response with User objects +*/ +type PostUsersOK struct { + Payload *sfgate_models.UserResponse +} + +// IsSuccess returns true when this post users o k response has a 2xx status code +func (o *PostUsersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this post users o k response has a 3xx status code +func (o *PostUsersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users o k response has a 4xx status code +func (o *PostUsersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this post users o k response has a 5xx status code +func (o *PostUsersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this post users o k response a status code equal to that given +func (o *PostUsersOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the post users o k response +func (o *PostUsersOK) Code() int { + return 200 +} + +func (o *PostUsersOK) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersOK %+v", 200, o.Payload) +} + +func (o *PostUsersOK) String() string { + return fmt.Sprintf("[POST /users][%d] postUsersOK %+v", 200, o.Payload) +} + +func (o *PostUsersOK) GetPayload() *sfgate_models.UserResponse { + return o.Payload +} + +func (o *PostUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(sfgate_models.UserResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersUnauthorized creates a PostUsersUnauthorized with default headers values +func NewPostUsersUnauthorized() *PostUsersUnauthorized { + return &PostUsersUnauthorized{} +} + +/* +PostUsersUnauthorized describes a response with status code 401, with default header values. + +Access unauthorized, invalid API-KEY was used +*/ +type PostUsersUnauthorized struct { + AccessControlAllowOrigin string + + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post users unauthorized response has a 2xx status code +func (o *PostUsersUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users unauthorized response has a 3xx status code +func (o *PostUsersUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users unauthorized response has a 4xx status code +func (o *PostUsersUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users unauthorized response has a 5xx status code +func (o *PostUsersUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this post users unauthorized response a status code equal to that given +func (o *PostUsersUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the post users unauthorized response +func (o *PostUsersUnauthorized) Code() int { + return 401 +} + +func (o *PostUsersUnauthorized) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostUsersUnauthorized) String() string { + return fmt.Sprintf("[POST /users][%d] postUsersUnauthorized %+v", 401, o.Payload) +} + +func (o *PostUsersUnauthorized) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostUsersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersForbidden creates a PostUsersForbidden with default headers values +func NewPostUsersForbidden() *PostUsersForbidden { + return &PostUsersForbidden{} +} + +/* +PostUsersForbidden describes a response with status code 403, with default header values. + +Access forbidden, account lacks access +*/ +type PostUsersForbidden struct { + AccessControlAllowOrigin string + + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post users forbidden response has a 2xx status code +func (o *PostUsersForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users forbidden response has a 3xx status code +func (o *PostUsersForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users forbidden response has a 4xx status code +func (o *PostUsersForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users forbidden response has a 5xx status code +func (o *PostUsersForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this post users forbidden response a status code equal to that given +func (o *PostUsersForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the post users forbidden response +func (o *PostUsersForbidden) Code() int { + return 403 +} + +func (o *PostUsersForbidden) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersForbidden %+v", 403, o.Payload) +} + +func (o *PostUsersForbidden) String() string { + return fmt.Sprintf("[POST /users][%d] postUsersForbidden %+v", 403, o.Payload) +} + +func (o *PostUsersForbidden) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostUsersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersNotFound creates a PostUsersNotFound with default headers values +func NewPostUsersNotFound() *PostUsersNotFound { + return &PostUsersNotFound{} +} + +/* +PostUsersNotFound describes a response with status code 404, with default header values. + +Resource was not found +*/ +type PostUsersNotFound struct { + AccessControlAllowOrigin string + + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post users not found response has a 2xx status code +func (o *PostUsersNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users not found response has a 3xx status code +func (o *PostUsersNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users not found response has a 4xx status code +func (o *PostUsersNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users not found response has a 5xx status code +func (o *PostUsersNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this post users not found response a status code equal to that given +func (o *PostUsersNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the post users not found response +func (o *PostUsersNotFound) Code() int { + return 404 +} + +func (o *PostUsersNotFound) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersNotFound %+v", 404, o.Payload) +} + +func (o *PostUsersNotFound) String() string { + return fmt.Sprintf("[POST /users][%d] postUsersNotFound %+v", 404, o.Payload) +} + +func (o *PostUsersNotFound) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostUsersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersUnprocessableEntity creates a PostUsersUnprocessableEntity with default headers values +func NewPostUsersUnprocessableEntity() *PostUsersUnprocessableEntity { + return &PostUsersUnprocessableEntity{} +} + +/* +PostUsersUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity, likely a bad parameter +*/ +type PostUsersUnprocessableEntity struct { + AccessControlAllowOrigin string + + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post users unprocessable entity response has a 2xx status code +func (o *PostUsersUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users unprocessable entity response has a 3xx status code +func (o *PostUsersUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users unprocessable entity response has a 4xx status code +func (o *PostUsersUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this post users unprocessable entity response has a 5xx status code +func (o *PostUsersUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this post users unprocessable entity response a status code equal to that given +func (o *PostUsersUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the post users unprocessable entity response +func (o *PostUsersUnprocessableEntity) Code() int { + return 422 +} + +func (o *PostUsersUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostUsersUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /users][%d] postUsersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *PostUsersUnprocessableEntity) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostUsersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostUsersInternalServerError creates a PostUsersInternalServerError with default headers values +func NewPostUsersInternalServerError() *PostUsersInternalServerError { + return &PostUsersInternalServerError{} +} + +/* +PostUsersInternalServerError describes a response with status code 500, with default header values. + +Server Internal Error +*/ +type PostUsersInternalServerError struct { + AccessControlAllowOrigin string + + Payload *sfgate_models.Error +} + +// IsSuccess returns true when this post users internal server error response has a 2xx status code +func (o *PostUsersInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this post users internal server error response has a 3xx status code +func (o *PostUsersInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this post users internal server error response has a 4xx status code +func (o *PostUsersInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this post users internal server error response has a 5xx status code +func (o *PostUsersInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this post users internal server error response a status code equal to that given +func (o *PostUsersInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the post users internal server error response +func (o *PostUsersInternalServerError) Code() int { + return 500 +} + +func (o *PostUsersInternalServerError) Error() string { + return fmt.Sprintf("[POST /users][%d] postUsersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostUsersInternalServerError) String() string { + return fmt.Sprintf("[POST /users][%d] postUsersInternalServerError %+v", 500, o.Payload) +} + +func (o *PostUsersInternalServerError) GetPayload() *sfgate_models.Error { + return o.Payload +} + +func (o *PostUsersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Access-Control-Allow-Origin + hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") + + if hdrAccessControlAllowOrigin != "" { + o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin + } + + o.Payload = new(sfgate_models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/sfgate/sfgate_client/users/users_client.go b/api/sfgate/sfgate_client/users/users_client.go index 1f2e709..21102f6 100644 --- a/api/sfgate/sfgate_client/users/users_client.go +++ b/api/sfgate/sfgate_client/users/users_client.go @@ -36,7 +36,7 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) - PostUser(params *PostUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUserOK, error) + PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOK, error) SetTransport(transport runtime.ClientTransport) } @@ -83,24 +83,24 @@ func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInf } /* -PostUser creates new salesforce user +PostUsers creates new salesforce user -Create a user record in Salesforce +Create user recorda in Salesforce */ -func (a *Client) PostUser(params *PostUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUserOK, error) { +func (a *Client) PostUsers(params *PostUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostUsersOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostUserParams() + params = NewPostUsersParams() } op := &runtime.ClientOperation{ - ID: "postUser", + ID: "postUsers", Method: "POST", PathPattern: "/users", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &PostUserReader{formats: a.formats}, + Reader: &PostUsersReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -113,13 +113,13 @@ func (a *Client) PostUser(params *PostUserParams, authInfo runtime.ClientAuthInf if err != nil { return nil, err } - success, ok := result.(*PostUserOK) + success, ok := result.(*PostUsersOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postUser: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for postUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/api/sfgate/sfgate_models/user_request.go b/api/sfgate/sfgate_models/user_request.go index da06ef3..0c93cfa 100644 --- a/api/sfgate/sfgate_models/user_request.go +++ b/api/sfgate/sfgate_models/user_request.go @@ -11,50 +11,27 @@ package sfgate_models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// UserRequest user request +// UserRequest An array of User Objects to post // // swagger:model UserRequest type UserRequest struct { - // API key - APIKey string `json:"APIKey,omitempty"` - - // address - Address *Address `json:"Address,omitempty"` - - // email - Email string `json:"Email,omitempty"` - - // environment - Environment string `json:"Environment,omitempty"` - - // first name - FirstName string `json:"FirstName,omitempty"` - - // ID - ID string `json:"ID,omitempty"` - - // last name - LastName string `json:"LastName,omitempty"` - - // taxnexus account - TaxnexusAccount string `json:"TaxnexusAccount,omitempty"` - - // title - Title string `json:"Title,omitempty"` + // data + Data []*User `json:"data"` } // Validate validates this user request func (m *UserRequest) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateAddress(formats); err != nil { + if err := m.validateData(formats); err != nil { res = append(res, err) } @@ -64,20 +41,27 @@ func (m *UserRequest) Validate(formats strfmt.Registry) error { return nil } -func (m *UserRequest) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required +func (m *UserRequest) validateData(formats strfmt.Registry) error { + if swag.IsZero(m.Data) { // not required return nil } - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Address") - } - return err + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + } return nil @@ -87,7 +71,7 @@ func (m *UserRequest) validateAddress(formats strfmt.Registry) error { func (m *UserRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateAddress(ctx, formats); err != nil { + if err := m.contextValidateData(ctx, formats); err != nil { res = append(res, err) } @@ -97,17 +81,21 @@ func (m *UserRequest) ContextValidate(ctx context.Context, formats strfmt.Regist return nil } -func (m *UserRequest) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { +func (m *UserRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - if m.Address != nil { - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Address") + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil diff --git a/swagger/clerk.json b/swagger/clerk.json new file mode 100644 index 0000000..1583c80 --- /dev/null +++ b/swagger/clerk.json @@ -0,0 +1,6909 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Clerk Backend API", + "x-logo": { + "url": "https://clerk.com/_next/image?url=%2Fimages%2Fclerk-logo.svg&w=96&q=75", + "altText": "Clerk docs", + "href": "https://clerk.com/docs", + }, + "contact": { + "email": "support@clerk.com", + "name": "Clerk Platform Team", + "url": "https://clerk.com/support", + }, + "description": "The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.", + "version": "v1", + "termsOfService": "https://clerk.com/terms", + "license": { + "name": "MIT", + "url": "https://github.com/clerkinc/clerk-sdk-go/blob/main/LICENSE", + }, + }, + "externalDocs": { + "url": "https://clerk.com/docs" + }, + "servers": [ + { + "url": "https://api.clerk.dev/v1" + }, + { + "url": "https://api.clerk.com/v1" + }, + ], + "security": [ + { + "bearerAuth": [] + } + ], + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer" + } + }, + "parameters": { + "LimitParameter": { + "name": "limit", + "in": "query", + "description": "Applies a limit to the number of results returned.\nCan be used for paginating the results together with `offset`.\nMust be an integer greater than zero and less than 500.\nBy default, if not supplied, a limit of 10 is used.", + "required": false, + "schema": { + "type": "number", + "default": 10, + "minimum": 1, + "maximum": 500, + }, + }, + "OffsetParameter": { + "name": "offset", + "in": "query", + "description": "Skip the first `offset` results when paginating.\nNeeds to be an integer greater or equal to zero.\nTo be used in conjunction with `limit`.", + "required": false, + "schema": { + "type": "number", + "default": 0, + "minimum": 0 + }, + }, + }, + "schemas": { + "Session": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "session" + ], + }, + "id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "actor": { + "type": "object", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "active", + "revoked", + "ended", + "expired", + "removed", + "abandoned", + ], + }, + "last_active_organization_id": { + "type": "string", + "nullable": true + }, + "last_active_at": { + "type": "integer" + }, + "expire_at": { + "type": "integer" + }, + "abandon_at": { + "type": "integer" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + }, + "required": [ + "object", + "id", + "user_id", + "client_id", + "status", + "last_active_at", + "expire_at", + "abandon_at", + "updated_at", + "created_at", + ], + }, + "Client": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "client" + ], + }, + "id": { + "type": "string", + "description": "String representing the identifier of the session.\n", + }, + "session_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "sessions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Session" + }, + }, + "sign_in_attempt_id": { + "type": "string", + "nullable": true, + "deprecated": true + }, + "sign_up_attempt_id": { + "type": "string", + "nullable": true, + "deprecated": true + }, + "sign_in_id": { + "type": "string", + "nullable": true + }, + "sign_up_id": { + "type": "string", + "nullable": true + }, + "last_active_session_id": { + "nullable": true, + "type": "string", + "description": "Last active session_id.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + }, + "required": [ + "object", + "id", + "session_ids", + "sessions", + "sign_in_attempt_id", + "sign_up_attempt_id", + "sign_in_id", + "sign_up_id", + "last_active_session_id", + "updated_at", + "created_at", + ], + }, + "ClerkError": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "long_message": { + "type": "string" + }, + "code": { + "type": "string" + }, + "meta": { + "type": "object" + }, + }, + "required": [ + "message", + "long_message", + "code" + ], + }, + "ClerkErrors": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClerkError" + }, + }, + "meta": { + "type": "object" + }, + }, + "required": [ + "errors" + ], + }, + "OTP": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "unverified", + "verified", + "failed", + "expired" + ], + }, + "strategy": { + "type": "string", + "enum": [ + "phone_code", + "email_code" + ] + }, + "attempts": { + "type": "integer" + }, + "expire_at": { + "type": "integer" + }, + }, + "required": [ + "status", + "attempts", + "strategy", + "expire_at" + ], + }, + "Admin": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "verified" + ] + }, + "strategy": { + "type": "string", + "enum": [ + "admin" + ] + }, + "attempts": { + "type": "integer", + "nullable": true + }, + "expire_at": { + "type": "integer", + "nullable": true + }, + }, + "required": [ + "status", + "strategy" + ], + }, + "IdentificationLink": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth_google", + "oauth_mock" + ], + }, + "id": { + "type": "string" + }, + }, + "required": [ + "type", + "id" + ], + }, + "EmailAddress": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "email_address" + ], + }, + "email_address": { + "type": "string" + }, + "reserved": { + "type": "boolean" + }, + "verification": { + "type": "object", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/OTP" + }, + { + "$ref": "#/components/schemas/Admin" + }, + ], + }, + "linked_to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IdentificationLink" + }, + }, + }, + "required": [ + "object", + "email_address", + "verification", + "linked_to", + "reserved", + ], + }, + "DeletedObject": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string" + }, + "id": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + }, + "required": [ + "object", + "deleted" + ], + }, + "PhoneNumber": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "phone_number" + ], + }, + "phone_number": { + "type": "string" + }, + "reserved_for_second_factor": { + "type": "boolean" + }, + "default_second_factor": { + "type": "boolean" + }, + "reserved": { + "type": "boolean" + }, + "verification": { + "type": "object", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/OTP" + }, + { + "$ref": "#/components/schemas/Admin" + }, + ], + }, + "linked_to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IdentificationLink" + }, + }, + "backup_codes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true, + }, + }, + "required": [ + "object", + "phone_number", + "verification", + "linked_to", + "reserved", + ], + }, + "Template": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "template" + ], + }, + "instance_id": { + "nullable": true, + "type": "string", + "description": "the id of the instance the template belongs to", + }, + "resource_type": { + "type": "string", + "description": "whether this is a system (default) or user overridden) template", + }, + "template_type": { + "type": "string", + "description": "whether this is an email or SMS template", + }, + "name": { + "type": "string", + "description": "user-friendly name of the template", + }, + "slug": { + "type": "string", + "description": "machine-friendly name of the template", + }, + "position": { + "type": "integer", + "description": "position with the listing of templates", + }, + "can_revert": { + "type": "boolean", + "description": "whether this template can be reverted to the corresponding system default", + }, + "can_delete": { + "type": "boolean", + "description": "whether this template can be deleted", + }, + "subject": { + "type": "string", + "description": "email subject", + "nullable": true, + }, + "markup": { + "type": "string", + "description": "the editor markup used to generate the body of the template", + }, + "body": { + "type": "string", + "description": "the template body before variable interpolation", + }, + "available_variables": { + "type": "array", + "description": "list of variables that are available for use in the template body", + "items": { + "type": "string" + }, + }, + "required_variables": { + "type": "array", + "description": "list of variables that must be contained in the template body", + "items": { + "type": "string" + }, + }, + "from_email_name": { + "type": "string" + }, + "delivered_by_clerk": { + "type": "boolean" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + }, + }, + "Web3Signature": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "enum": [ + "verified" + ] + }, + "strategy": { + "type": "string", + "enum": [ + "web3_metamask_signature" + ] + }, + "nonce": { + "type": "string", + "enum": [ + "nonce" + ] + }, + "attempts": { + "type": "integer", + "nullable": true + }, + "expire_at": { + "type": "integer", + "nullable": true + }, + }, + "required": [ + "status", + "strategy", + "nonce" + ], + }, + "Web3Wallet": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "web3_wallet" + ], + }, + "web3_wallet": { + "type": "string" + }, + "verification": { + "type": "object", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/Web3Signature" + }, + { + "$ref": "#/components/schemas/Admin" + }, + ], + }, + }, + "required": [ + "object", + "web3_wallet", + "verification" + ], + }, + "User": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "user" + ], + }, + "external_id": { + "nullable": true, + "type": "string" + }, + "primary_email_address_id": { + "nullable": true, + "type": "string" + }, + "primary_phone_number_id": { + "nullable": true, + "type": "string" + }, + "primary_web3_wallet_id": { + "nullable": true, + "type": "string" + }, + "username": { + "nullable": true, + "type": "string" + }, + "first_name": { + "nullable": true, + "type": "string" + }, + "last_name": { + "nullable": true, + "type": "string" + }, + "profile_image_url": { + "type": "string", + "deprecated": true + }, + "image_url": { + "type": "string" + }, + "public_metadata": { + "type": "object" + }, + "private_metadata": { + "nullable": true, + "type": "object" + }, + "unsafe_metadata": { + "type": "object" + }, + "gender": { + "nullable": true, + "type": "string" + }, + "birthday": { + "nullable": true, + "type": "string" + }, + "email_addresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmailAddress" + }, + }, + "phone_numbers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PhoneNumber" + }, + }, + "web3_wallets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Web3Wallet" + }, + }, + "password_enabled": { + "type": "boolean" + }, + "two_factor_enabled": { + "type": "boolean" + }, + "totp_enabled": { + "type": "boolean" + }, + "backup_code_enabled": { + "type": "boolean" + }, + "external_accounts": { + "type": "array", + "items": { + "type": "object" + } + }, + "last_sign_in_at": { + "type": "integer", + "format": "int64", + "nullable": true, + "description": "Unix timestamp of last sign-in.\n", + }, + "banned": { + "type": "boolean", + "description": "Flag to denote whether user is banned or not.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + }, + }, + "TotalCount": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "total_count" + ], + }, + "total_count": { + "type": "integer", + "format": "int64" + }, + }, + "required": [ + "object", + "total_count" + ], + }, + "Organization": { + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "organization" + ] + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "members_count": { + "type": "integer", + "nullable": true + }, + "max_allowed_memberships": { + "type": "integer" + }, + "public_metadata": { + "type": "object" + }, + "private_metadata": { + "type": "object" + }, + "created_by": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + "required": [ + "object", + "id", + "name", + "slug", + "max_allowed_memberships", + "public_metadata", + "private_metadata", + "created_at", + "updated_at", + ], + }, + "OrganizationMembership": { + "description": "Hello world", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "organization_membership" + ], + }, + "role": { + "type": "string", + "enum": [ + "admin", + "basic_member" + ] + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.", + }, + "organization": { + "type": "object", + "nullable": false, + "allOf": [ + { + "$ref": "#/components/schemas/Organization" + } + ], + }, + "public_user_data": { + "type": "object", + "additionalProperties": false, + "properties": { + "user_id": { + "type": "string", + "nullable": false + }, + "first_name": { + "type": "string", + "nullable": true + }, + "last_name": { + "type": "string", + "nullable": true + }, + "profile_image_url": { + "type": "string", + "nullable": true, + "deprecated": true, + }, + "image_url": { + "type": "string", + "nullable": true + }, + "identifier": { + "type": "string", + "nullable": true + }, + }, + }, + }, + }, + "OrganizationMemberships": { + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrganizationMembership", + }, + }, + "total_count": { + "type": "integer", + "format": "int64", + "description": "Total number of organization memberships\n", + }, + }, + "required": [ + "data", + "total_count" + ], + }, + "Email": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "email" + ] + }, + "id": { + "type": "string" + }, + "slug": { + "type": "string", + "nullable": true + }, + "from_email_name": { + "type": "string" + }, + "email_address_id": { + "type": "string", + "nullable": true + }, + "to_email_address": { + "type": "string" + }, + "user_id": { + "type": "string", + "nullable": true + }, + "subject": { + "type": "string" + }, + "body": { + "type": "string" + }, + "body_plain": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string" + }, + "data": { + "type": "object", + "nullable": true + }, + "delivered_by_clerk": { + "type": "boolean" + }, + }, + "required": [ + "object", + "id", + "from_email_name", + "email_address_id", + "to_email_address", + "subject", + "body", + "status", + "delivered_by_clerk", + ], + }, + "SMSMessage": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "sms_message" + ] + }, + "id": { + "type": "string" + }, + "slug": { + "type": "string", + "nullable": true + }, + "from_phone_number": { + "type": "string" + }, + "to_phone_number": { + "type": "string" + }, + "phone_number_id": { + "type": "string", + "nullable": true + }, + "user_id": { + "type": "string", + "nullable": true + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + }, + "data": { + "type": "object", + "nullable": true + }, + "delivered_by_clerk": { + "type": "boolean" + }, + }, + "required": [ + "object", + "id", + "from_phone_number", + "to_phone_number", + "phone_number_id", + "message", + "status", + "delivered_by_clerk", + ], + }, + "Invitation": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "invitation" + ] + }, + "id": { + "type": "string" + }, + "email_address": { + "type": "string", + "format": "email" + }, + "public_metadata": { + "type": "object" + }, + "revoked": { + "type": "boolean", + "example": true + }, + "status": { + "type": "string", + "enum": [ + "pending", + "accepted", + "revoked" + ], + "example": "revoked", + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + "required": [ + "object", + "id", + "email_address", + "status", + "created_at", + "updated_at", + ], + }, + "AllowlistIdentifier": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "allowlist_identifier" + ], + }, + "id": { + "type": "string" + }, + "invitation_id": { + "type": "string" + }, + "identifier": { + "type": "string", + "description": "An email address or a phone number.\n", + }, + "identifier_type": { + "type": "string", + "enum": [ + "email_address", + "phone_number", + "web3_wallet" + ], + }, + "instance_id": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + }, + "BlocklistIdentifier": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "blocklist_identifier" + ], + }, + "id": { + "type": "string" + }, + "identifier": { + "type": "string", + "description": "An email address, email domain, phone number or web3 wallet.\n", + }, + "identifier_type": { + "type": "string", + "enum": [ + "email_address", + "phone_number", + "web3_wallet" + ], + }, + "instance_id": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + }, + "BlocklistIdentifiers": { + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BlocklistIdentifier" + }, + }, + "total_count": { + "type": "integer", + "format": "int64", + "description": "Total number of blocklist identifiers\n", + }, + }, + "required": [ + "data", + "total_count" + ], + }, + "ActorToken": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "actor_token" + ] + }, + "id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "accepted", + "revoked" + ], + }, + "user_id": { + "type": "string" + }, + "actor": { + "type": "object" + }, + "token": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + "required": [ + "object", + "id", + "user_id", + "actor", + "status", + "created_at", + "updated_at", + ], + }, + "InstanceRestrictions": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.", + "enum": [ + "instance_restrictions" + ], + }, + "allowlist": { + "type": "boolean" + }, + "blocklist": { + "type": "boolean" + }, + }, + }, + "OrganizationSettings": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.", + "enum": [ + "organization_settings" + ], + }, + "enabled": { + "type": "boolean" + }, + "max_allowed_memberships": { + "type": "integer" + }, + }, + "required": [ + "object", + "enabled", + "max_allowed_memberships" + ], + }, + "SvixURL": { + "type": "object", + "additionalProperties": false, + "properties": { + "svix_url": { + "type": "string" + } + }, + "required": [ + "svix_url" + ], + }, + "JWTTemplate": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "jwt_template" + ] + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "claims": { + "type": "object" + }, + "lifetime": { + "type": "integer" + }, + "allowed_clock_skew": { + "type": "integer" + }, + "custom_signing_key": { + "type": "boolean" + }, + "signing_algorithm": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + "required": [ + "object", + "id", + "name", + "claims", + "lifetime", + "allowed_clock_skew", + "created_at", + "updated_at", + ], + }, + "Organizations": { + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Organization" + }, + }, + "total_count": { + "type": "integer", + "format": "int64", + "description": "Total number of organizations\n", + }, + }, + "required": [ + "data", + "total_count" + ], + }, + "OrganizationWithLogo": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Organization" + }, + { + "type": "object", + "properties": { + "logo_url": { + "type": "string", + "deprecated": true + }, + "image_url": { + "type": "string" + }, + }, + "required": [ + "logo_url", + "image_url" + ], + }, + ], + }, + "OrganizationInvitation": { + "description": "An organization invitation", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.\n", + "enum": [ + "organization_invitation" + ], + }, + "email_address": { + "type": "string" + }, + "role": { + "type": "string", + "enum": [ + "admin", + "basic_member" + ] + }, + "organization_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.", + }, + }, + }, + "OrganizationInvitations": { + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrganizationInvitation", + }, + }, + "total_count": { + "type": "integer", + "format": "int64", + "description": "Total number of organization invitations\n", + }, + }, + "required": [ + "data", + "total_count" + ], + }, + "RedirectURL": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "redirect_url" + ] + }, + "id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + "required": [ + "object", + "id", + "url", + "created_at", + "updated_at" + ], + }, + "SignInToken": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "sign_in_token" + ] + }, + "id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "accepted", + "revoked" + ], + }, + "user_id": { + "type": "string" + }, + "token": { + "type": "string" + }, + "url": { + "type": "string", + "nullable": true + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + "required": [ + "object", + "id", + "user_id", + "status", + "created_at", + "updated_at", + ], + }, + "SignUp": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "sign_up_attempt" + ] + }, + "id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "missing_requirements", + "complete", + "abandoned" + ], + }, + "required_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "optional_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "missing_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "unverified_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "verifications": { + "type": "object" + }, + "username": { + "type": "string", + "nullable": true + }, + "email_address": { + "type": "string", + "nullable": true + }, + "phone_number": { + "type": "string", + "nullable": true + }, + "web3_wallet": { + "type": "string", + "nullable": true + }, + "password_enabled": { + "type": "boolean" + }, + "first_name": { + "type": "string", + "nullable": true + }, + "last_name": { + "type": "string", + "nullable": true + }, + "unsafe_metadata": { + "type": "object" + }, + "public_metadata": { + "type": "object" + }, + "custom_action": { + "type": "boolean" + }, + "external_id": { + "type": "string", + "nullable": true + }, + "created_session_id": { + "type": "string", + "nullable": true + }, + "created_user_id": { + "type": "string", + "nullable": true + }, + "abandon_at": { + "type": "integer" + }, + "identification_requirements": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + }, + "missing_requirements": { + "type": "array", + "items": { + "type": "string" + } + }, + "email_address_verification": { + "type": "object", + "nullable": true, + "deprecated": true + }, + "phone_number_verification": { + "type": "object", + "nullable": true, + "deprecated": true + }, + "external_account_strategy": { + "type": "string", + "nullable": true + }, + "external_account_verification": { + "type": "object", + "nullable": true, + "deprecated": true + }, + "external_account": { + "type": "object" + }, + }, + "required": [ + "object", + "id", + "status", + "password_enabled", + "custom_action", + "abandon_at", + ], + }, + "OAuthApplication": { + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "oauth_application" + ] + }, + "id": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "scopes": { + "type": "string" + }, + "callback_url": { + "type": "string" + }, + "authorize_url": { + "type": "string" + }, + "token_fetch_url": { + "type": "string" + }, + "user_info_url": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of creation.\n", + }, + "updated_at": { + "type": "integer", + "format": "int64", + "description": "Unix timestamp of last update.\n", + }, + }, + "required": [ + "object", + "id", + "instance_id", + "name", + "client_id", + "scopes", + "callback_url", + "authorize_url", + "token_fetch_url", + "user_info_url", + "created_at", + "updated_at", + ], + }, + "OAuthApplications": { + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OAuthApplication" + }, + }, + "total_count": { + "type": "integer", + "format": "int64", + "description": "Total number of OAuth applications\n", + }, + }, + "required": [ + "data", + "total_count" + ], + }, + "OAuthApplicationWithSecret": { + "allOf": [ + { + "$ref": "#/components/schemas/OAuthApplication" + }, + { + "type": "object", + "properties": { + "client_secret": { + "type": "string" + } + }, + "required": [ + "client_secret" + ], + }, + ], + }, + }, + "responses": { + "Client.List": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Client" + }, + }, + }, + }, + }, + "ClerkErrors": { + "description": "Request was not successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClerkErrors" + }, + }, + }, + }, + "AuthenticationInvalid": { + "description": "Authentication invalid", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClerkErrors" + }, + }, + }, + }, + "UnprocessableEntity": { + "description": "Invalid request parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClerkErrors" + }, + }, + }, + }, + "Client": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Client" + } + }, + }, + }, + "ResourceNotFound": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClerkErrors" + }, + }, + }, + }, + "Session": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Session" + } + }, + }, + }, + "EmailAddress": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EmailAddress" + }, + }, + }, + }, + "AuthorizationInvalid": { + "description": "Authorization invalid", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClerkErrors" + }, + }, + }, + }, + "DeletedObject": { + "description": "Deleted Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletedObject" + }, + }, + }, + }, + "PhoneNumber": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PhoneNumber" + }, + }, + }, + }, + "Session.List": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Session" + }, + }, + }, + }, + }, + "Template.List": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Template" + }, + }, + }, + }, + }, + "Template": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Template" + } + }, + }, + }, + "PaymentRequired": { + "description": "Payment required", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClerkErrors" + }, + }, + }, + }, + "User.List": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + }, + }, + }, + }, + }, + "User": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + }, + }, + }, + "User.Count": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TotalCount" + } + }, + }, + }, + "OrganizationMemberships": { + "description": "A list of organization memberships", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationMemberships", + }, + }, + }, + }, + "Email": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Email" + } + }, + }, + }, + "SMSMessage": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SMSMessage" + } + }, + }, + }, + "Invitation.List": { + "description": "List of invitations", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invitation" + }, + }, + }, + }, + }, + "Invitation": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + }, + }, + }, + "AllowlistIdentifier.List": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AllowlistIdentifier", + }, + }, + }, + }, + }, + "AllowlistIdentifier": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AllowlistIdentifier" + }, + }, + }, + }, + "BlocklistIdentifier.List": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlocklistIdentifiers" + }, + }, + }, + }, + "BlocklistIdentifier": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlocklistIdentifier" + }, + }, + }, + }, + "InstanceSettings": { + "description": "InstanceSettings Server API", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "String representing the object's type. Objects of the same type share the same value.", + "enum": [ + "instance_settings" + ], + }, + "id": { + "type": "string" + }, + "restricted_to_allowlist": { + "type": "boolean" + }, + "from_email_address": { + "type": "string" + }, + "progressive_sign_up": { + "type": "boolean" + }, + "enhanced_email_deliverability": { + "type": "boolean" + }, + }, + }, + }, + }, + }, + "ActorToken": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActorToken" + } + }, + }, + }, + "InstanceRestrictions": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstanceRestrictions" + }, + }, + }, + }, + "OrganizationSettings": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationSettings" + }, + }, + }, + }, + "SvixURL": { + "description": "Response that contains a temporary Svix URL to access management dashboard", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SvixURL" + } + }, + }, + }, + "JWTTemplate.List": { + "description": "List of JWT templates", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JWTTemplate" + }, + }, + }, + }, + }, + "JWTTemplate": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JWTTemplate" + }, + }, + }, + }, + "Organizations": { + "description": "A list of organizations", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organizations" + }, + }, + }, + }, + "Organization": { + "description": "An organization", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + }, + }, + }, + }, + "OrganizationWithLogo": { + "description": "An organization with a logo URL.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationWithLogo" + }, + }, + }, + }, + "OrganizationInvitation": { + "description": "An organization invitation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationInvitation", + }, + }, + }, + }, + "OrganizationInvitations": { + "description": "A list of organization invitations", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationInvitations", + }, + }, + }, + }, + "OrganizationMembership": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationMembership", + }, + }, + }, + }, + "RedirectURL.List": { + "description": "List of Redirect URLs", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RedirectURL" + }, + }, + }, + }, + }, + "RedirectURL": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RedirectURL" + }, + }, + }, + }, + "SignInToken": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignInToken" + }, + }, + }, + }, + "SignUp": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignUp" + } + }, + }, + }, + "OAuthApplications": { + "description": "A list of OAuth applications", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuthApplications" + }, + }, + }, + }, + "OAuthApplicationWithSecret": { + "description": "An OAuth application with client secret", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuthApplicationWithSecret", + }, + }, + }, + }, + "OAuthApplication": { + "description": "An OAuth application", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuthApplication" + }, + }, + }, + }, + }, + }, + "tags": [ + { + "name": "Actor Tokens", + "description": "Allow your users to sign in on behalf of other users.", + "externalDocs": { + "url": "https://clerk.com/docs/authentication/user-impersonation#actor-tokens", + }, + }, + { + "name": "Allow-list / Block-list", + "description": "Allow-lists and Block-lists allow you to control who can sign up or sign in\nto your application, by restricting access based on the user's email\naddress or phone number.", + "externalDocs": { + "url": "https://clerk.com/docs/authentication/allowlist" + }, + }, + { + "name": "Clients", + "description": "The Client object tracks sessions, as well as the state of any sign in and sign up attempts, for a given device.", + "externalDocs": { + "url": "https://clerk.com/docs/reference/clerkjs/client" + }, + }, + { + "name": "Email Addresses", + "description": "A user can be associated with one or more email addresses and allows them to be contacted via email.", + "externalDocs": { + "url": "https://clerk.com/docs/reference/clerkjs/emailaddress" + }, + }, + { + "name": "Emails", + "description": "The email object represents an email that has been sent to an email address.\nYou can only send an email to email addresses that have been verified by a user.\nOnly recommended for transactional emails.", + }, + { + "name": "Email & SMS Templates", + "description": "Email & SMS templates allow you to customize the theming and wording of emails & SMS messages that are sent by your instance.", + "externalDocs": { + "url": "https://clerk.com/docs/authentication/email-sms-templates", + }, + }, + { + "name": "Instance Settings", + "description": "Modify the settings of your instance.", + }, + { + "name": "Invitations", + "description": "Invitations allow you to invite someone to sign up to your application, via email.", + "externalDocs": { + "url": "https://clerk.com/docs/authentication/invitations" + }, + }, + { + "name": "JWKS", + "description": "Retrieve the JSON Web Key Set which can be used to verify the token signatures of the instance.", + }, + { + "name": "JWT Templates", + "description": "JWT Templates allow you to generate custom authentication tokens\ntied to authenticated sessions, enabling you to integrate with third-party\nservices.", + "externalDocs": { + "url": "https://clerk.com/docs/request-authentication/jwt-templates", + }, + }, + { + "name": "OAuth Applications", + "description": "OAuth applications contain data for clients using Clerk as an OAuth2 identity provider.", + }, + { + "name": "Organizations", + "description": "Organizations are used to group members under a common entity and provide shared access to resources.", + "externalDocs": { + "url": "https://clerk.com/docs/organizations/overview" + }, + }, + { + "name": "Organization Invitations", + "description": "Invite users to an organization.", + "externalDocs": { + "url": "https://clerk.com/docs/organizations/invite-users" + }, + }, + { + "name": "Organization Memberships", + "description": "Manage member roles in an organization.", + "externalDocs": { + "url": "https://clerk.com/docs/organizations/manage-member-roles" + }, + }, + { + "name": "Phone Numbers", + "description": "A user can be associated with one or more email addresses and allows them to be contacted via SMS.", + "externalDocs": { + "url": "https://clerk.com/docs/reference/clerkjs/phonenumber" + }, + }, + { + "name": "Redirect URLs", + "description": "Redirect URLs are whitelisted URLs that facilitate secure authentication flows in native applications (e.g. React Native, Expo).\nIn these contexts, Clerk ensures that security-critical nonces are passed only to the whitelisted URLs.", + }, + { + "name": "Sessions", + "description": "The Session object is an abstraction over an HTTP session.\nIt models the period of information exchange between a user and the server.\nSessions are created when a user successfully goes through the sign in or sign up flows.", + "externalDocs": { + "url": "https://clerk.com/docs/reference/clerkjs/session" + }, + }, + { + "name": "Sign-in Tokens", + "description": "Sign-in tokens are JWTs that can be used to sign in to an application without specifying any credentials.\nA sign-in token can be used at most once and they can be consumed from the Frontend API using the `ticket` strategy.", + }, + { + "name": "SMS Messages", + "description": "SMS messages can be sent to verified phone numbers that belong to users.\nThis functionality is only recommended for transactional SMS messages.", + }, + { + "name": "Users", + "description": "The user object represents a user that has successfully signed up to your application.", + "externalDocs": { + "url": "https://clerk.com/docs/reference/clerkjs/user" + }, + }, + { + "name": "Webhooks", + "description": "You can configure webhooks to be notified about various events that happen on your instance.", + "externalDocs": { + "url": "https://clerk.com/docs/integration/webhooks" + }, + }, + { + "name": "Miscellaneous", + "description": "Various endpoints that do not belong in any particular category.", + }, + { + "name": "Beta Features", + "description": "Modify instance settings that are currently in beta.", + }, + ], + "paths": { + "/public/demo_instance": { + "post": { + "security": [], + "operationId": "CreateDemoInstance", + "summary": "Create a demo development instance", + "description": "Creates a demo development instance and returns the corresponding Frontend/Backend API keys.", + "tags": [ + "Miscellaneous" + ], + "responses": { + "200": { + "description": "The API keys of the created instance.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string", + "enum": [ + "demo_dev_instance" + ], + }, + "frontend_api_key": { + "type": "string" + }, + "backend_api_key": { + "type": "string" + }, + "jwt_verification_key": { + "type": "string", + "description": "The public key that can be used to verify the session tokens of the created instance.", + }, + "accounts_url": { + "type": "string", + "description": "The URL of the hosted Accounts Portal of the created instance.", + "format": "uri", + }, + }, + }, + }, + }, + }, + }, + }, + }, + "/public/interstitial": { + "get": { + "security": [], + "summary": "Returns the markup for the interstitial page", + "description": "The Clerk interstitial endpoint serves an html page that loads clerk.js in order to check the user's authentication state.\nIt is used by Clerk SDKs when the user's authentication state cannot be immediately determined.", + "operationId": "GetPublicInterstitial", + "tags": [ + "Miscellaneous" + ], + "parameters": [ + { + "name": "frontendApi", + "in": "query", + "required": false, + "description": "The Frontend API key of your instance", + "schema": { + "type": "string" + }, + }, + { + "name": "publishable_key", + "in": "query", + "required": false, + "description": "The publishable key of your instance", + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "description": "The interstitial page markup" + }, + "400": { + "description": "A required query parameter is missing" + }, + }, + }, + }, + "/jwks": { + "get": { + "operationId": "GetJWKS", + "summary": "Retrieve the JSON Web Key Set of the instance", + "description": "Retrieve the JSON Web Key Set of the instance", + "tags": [ + "JWKS" + ], + "responses": { + "200": { + "description": "The JSON Web Key Set" + } + }, + }, + }, + "/clients": { + "get": { + "operationId": "GetClientList", + "tags": [ + "Clients" + ], + "summary": "List all clients", + "description": "Returns a list of all clients. The clients are returned sorted by creation date,\nwith the newest clients appearing first.", + "parameters": [ + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Client.List" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/clients/verify": { + "post": { + "operationId": "VerifyClient", + "tags": [ + "Clients" + ], + "summary": "Verify a client", + "description": "Verifies the client in the provided token", + "requestBody": { + "description": "Parameters.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "token": { + "type": "string", + "description": "A JWT Token that represents the active client.", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Client" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/clients/{client_id}": { + "get": { + "operationId": "GetClient", + "tags": [ + "Clients" + ], + "summary": "Get a client", + "description": "Returns the details of a client.", + "parameters": [ + { + "name": "client_id", + "in": "path", + "description": "Client ID.", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Client" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/clients/{client_id}/last_active_session": { + "get": { + "operationId": "GetClientLastActiveSession", + "tags": [ + "Clients" + ], + "summary": "Get the last active session of a client", + "description": "Returns the details of the last active session of a client.", + "parameters": [ + { + "name": "client_id", + "in": "path", + "description": "Client ID.", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Session" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/email_addresses": { + "post": { + "operationId": "CreateEmailAddress", + "tags": [ + "Email Addresses" + ], + "summary": "Create an email address", + "description": "Create a new email address", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { + "type": "string", + "description": "The ID representing the user", + }, + "email_address": { + "type": "string", + "description": "The new email address. Must adhere to the RFC 5322 specification for email address format.", + }, + "verified": { + "type": "boolean", + "description": "When created, the email address will be marked as verified.", + "nullable": true, + }, + "primary": { + "type": "boolean", + "description": "Create this email address as the primary email address for the user.\nDefault: false, unless it is the first email address.", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/EmailAddress" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/email_addresses/{email_address_id}": { + "get": { + "operationId": "GetEmailAddress", + "tags": [ + "Email Addresses" + ], + "summary": "Retrieve an email address", + "description": "Returns the details of an email address.", + "parameters": [ + { + "name": "email_address_id", + "in": "path", + "description": "The ID of the email address to retrieve", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/EmailAddress" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "delete": { + "operationId": "DeleteEmailAddress", + "tags": [ + "Email Addresses" + ], + "summary": "Delete an email address", + "description": "Delete the email address with the given ID", + "parameters": [ + { + "name": "email_address_id", + "in": "path", + "description": "The ID of the email address to delete", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "patch": { + "operationId": "UpdateEmailAddress", + "tags": [ + "Email Addresses" + ], + "summary": "Update an email address", + "description": "Updates an email address.", + "parameters": [ + { + "name": "email_address_id", + "in": "path", + "description": "The ID of the email address to update", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "verified": { + "type": "boolean", + "description": "The email address will be marked as verified.", + "nullable": true, + }, + "primary": { + "type": "boolean", + "description": "Set this email address as the primary email address for the user.", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/EmailAddress" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/phone_numbers": { + "post": { + "operationId": "CreatePhoneNumber", + "tags": [ + "Phone Numbers" + ], + "summary": "Create a phone number", + "description": "Create a new phone number", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { + "type": "string", + "description": "The ID representing the user", + }, + "phone_number": { + "type": "string", + "description": "The new phone number. Must adhere to the E.164 standard for phone number format.", + }, + "verified": { + "type": "boolean", + "description": "When created, the phone number will be marked as verified.", + "nullable": true, + }, + "primary": { + "type": "boolean", + "description": "Create this phone number as the primary phone number for the user.\nDefault: false, unless it is the first phone number.", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/PhoneNumber" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/phone_numbers/{phone_number_id}": { + "get": { + "operationId": "GetPhoneNumber", + "tags": [ + "Phone Numbers" + ], + "summary": "Retrieve a phone number", + "description": "Returns the details of a phone number", + "parameters": [ + { + "name": "phone_number_id", + "in": "path", + "description": "The ID of the phone number to retrieve", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/PhoneNumber" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "delete": { + "operationId": "DeletePhoneNumber", + "tags": [ + "Phone Numbers" + ], + "summary": "Delete a phone number", + "description": "Delete the phone number with the given ID", + "parameters": [ + { + "name": "phone_number_id", + "in": "path", + "description": "The ID of the phone number to delete", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "patch": { + "operationId": "UpdatePhoneNumber", + "tags": [ + "Phone Numbers" + ], + "summary": "Update a phone number", + "description": "Updates a phone number", + "parameters": [ + { + "name": "phone_number_id", + "in": "path", + "description": "The ID of the phone number to update", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "verified": { + "type": "boolean", + "description": "The phone number will be marked as verified.", + "nullable": true, + }, + "primary": { + "type": "boolean", + "description": "Set this phone number as the primary phone number for the user.", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/PhoneNumber" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/sessions": { + "get": { + "operationId": "GetSessionList", + "tags": [ + "Sessions" + ], + "summary": "List all sessions", + "description": "Returns a list of all sessions.\nThe sessions are returned sorted by creation date, with the newest sessions appearing first.", + "parameters": [ + { + "name": "client_id", + "in": "query", + "required": false, + "description": "List sessions for the given client", + "schema": { + "type": "string" + }, + }, + { + "name": "user_id", + "in": "query", + "required": false, + "description": "List sessions for the given user", + "schema": { + "type": "string" + }, + }, + { + "name": "status", + "in": "query", + "required": false, + "description": "Filter sessions by the provided status", + "schema": { + "type": "string", + "enum": [ + "abandoned", + "active", + "ended", + "expired", + "removed", + "replaced", + "revoked", + ], + }, + }, + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Session.List" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/sessions/{session_id}": { + "get": { + "operationId": "GetSession", + "tags": [ + "Sessions" + ], + "summary": "Retrieve a session", + "description": "Retrieve the details of a session", + "parameters": [ + { + "name": "session_id", + "in": "path", + "description": "The ID of the session", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Session" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/sessions/{session_id}/revoke": { + "post": { + "operationId": "RevokeSession", + "tags": [ + "Sessions" + ], + "summary": "Revoke a session", + "description": "Sets the status of a session as \"revoked\", which is an unauthenticated state.\nIn multi-session mode, a revoked session will still be returned along with its client object, however the user will need to sign in again.", + "parameters": [ + { + "name": "session_id", + "in": "path", + "description": "The ID of the session", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Session" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/sessions/{session_id}/verify": { + "post": { + "operationId": "VerifySession", + "tags": [ + "Sessions" + ], + "summary": "Verify a session", + "description": "Returns the session if it is authenticated, otherwise returns an error.", + "parameters": [ + { + "name": "session_id", + "in": "path", + "description": "The ID of the session", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "description": "Parameters.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "token": { + "type": "string", + "description": "The JWT that is sent via the `__session` cookie from your frontend.\nNote: this JWT must be associated with the supplied session ID.", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Session" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/sessions/{session_id}/tokens/{template_name}": { + "post": { + "operationId": "CreateSessionTokenFromTemplate", + "tags": [ + "Sessions" + ], + "summary": "Create a session token from a jwt template", + "description": "Creates a JSON Web Token(JWT) based on a session and a JWT Template name defined for your instance", + "parameters": [ + { + "name": "session_id", + "in": "path", + "description": "The ID of the session", + "required": true, + "schema": { + "type": "string" + }, + }, + { + "name": "template_name", + "in": "path", + "description": "The name of the JWT Template defined in your instance (e.g. `custom_hasura`).", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "token" + ] + }, + "jwt": { + "type": "string" + }, + }, + }, + }, + }, + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/templates/{template_type}": { + "get": { + "operationId": "GetTemplateList", + "summary": "List all templates", + "description": "Returns a list of all templates.\nThe templates are returned sorted by position.", + "tags": [ + "Email & SMS Templates" + ], + "parameters": [ + { + "name": "template_type", + "in": "path", + "description": "The type of templates to list (email or SMS)", + "required": true, + "schema": { + "type": "string", + "enum": [ + "email", + "sms" + ] + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Template.List" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/templates/{template_type}/{slug}": { + "get": { + "operationId": "GetTemplate", + "summary": "Retrieve a template", + "description": "Returns the details of a template", + "tags": [ + "Email & SMS Templates" + ], + "parameters": [ + { + "name": "template_type", + "in": "path", + "description": "The type of templates to retrieve (email or SMS)", + "required": true, + "schema": { + "type": "string", + "enum": [ + "email", + "sms" + ] + }, + }, + { + "name": "slug", + "in": "path", + "description": "The slug (i.e. machine-friendly name) of the template to retrieve", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Template" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "put": { + "operationId": "UpsertTemplate", + "summary": "Update a template for a given type and slug", + "description": "Updates the existing template of the given type and slug", + "tags": [ + "Email & SMS Templates" + ], + "parameters": [ + { + "name": "template_type", + "in": "path", + "description": "The type of template to update", + "required": true, + "schema": { + "type": "string", + "enum": [ + "email", + "sms" + ] + }, + }, + { + "name": "slug", + "in": "path", + "description": "The slug of the template to update", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The user-friendly name of the template", + }, + "subject": { + "type": "string", + "description": "The email subject.\nApplicable only to email templates.", + "nullable": true, + }, + "markup": { + "type": "string", + "description": "The editor markup used to generate the body of the template", + "nullable": true, + }, + "body": { + "type": "string", + "description": "The template body before variable interpolation", + }, + "delivered_by_clerk": { + "type": "boolean", + "description": "Whether Clerk should deliver emails or SMS messages based on the current template", + "nullable": true, + }, + "from_email_name": { + "type": "string", + "description": "The local part of the From email address that will be used for emails.\nFor example, in the address 'hello@example.com', the local part is 'hello'.\nApplicable only to email templates.", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Template" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/templates/{template_type}/{slug}/revert": { + "post": { + "operationId": "RevertTemplate", + "summary": "Revert a template", + "description": "Reverts an updated template to its default state", + "tags": [ + "Email & SMS Templates" + ], + "parameters": [ + { + "name": "template_type", + "in": "path", + "description": "The type of template to revert", + "required": true, + "schema": { + "type": "string", + "enum": [ + "email", + "sms" + ] + }, + }, + { + "name": "slug", + "in": "path", + "description": "The slug of the template to revert", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Template" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/templates/{template_type}/{slug}/preview": { + "post": { + "operationId": "PreviewTemplate", + "summary": "Preview changes to a template", + "description": "Returns a preview of a template for a given template_type, slug and body", + "tags": [ + "Email & SMS Templates" + ], + "parameters": [ + { + "name": "template_type", + "in": "path", + "description": "The type of template to preview", + "required": true, + "schema": { + "type": "string" + }, + }, + { + "name": "slug", + "in": "path", + "description": "The slug of the template to preview", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "description": "Required parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "subject": { + "type": "string", + "description": "The email subject.\nApplicable only to email templates.", + "nullable": true, + }, + "body": { + "type": "string", + "description": "The template body before variable interpolation", + }, + "from_email_name": { + "type": "string", + "description": "The local part of the From email address that will be used for emails.\nFor example, in the address 'hello@example.com', the local part is 'hello'.\nApplicable only to email templates.", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object" + } + }, + }, + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/users": { + "get": { + "operationId": "GetUserList", + "summary": "List all users", + "description": "Returns a list of all users.\nThe users are returned sorted by creation date, with the newest users appearing first.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "email_address", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Returns users with the specified email addresses.\nAccepts up to 100 email addresses.\nAny email addresses not found are ignored.", + "required": false, + }, + { + "name": "phone_number", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Returns users with the specified phone numbers.\nAccepts up to 100 phone numbers.\nAny phone numbers not found are ignored.", + "required": false, + }, + { + "name": "external_id", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Returns users with the specified external ids.\nFor each external id, the `+` and `-` can be\nprepended to the id, which denote whether the\nrespective external id should be included or\nexcluded from the result set.\nAccepts up to 100 external ids.\nAny external ids not found are ignored.", + "required": false, + }, + { + "name": "username", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Returns users with the specified usernames.\nAccepts up to 100 usernames.\nAny usernames not found are ignored.", + "required": false, + }, + { + "name": "web3_wallet", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Returns users with the specified web3 wallet addresses.\nAccepts up to 100 web3 wallet addresses.\nAny web3 wallet addressed not found are ignored.", + "required": false, + }, + { + "name": "user_id", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Returns users with the user ids specified.\nFor each user id, the `+` and `-` can be\nprepended to the id, which denote whether the\nrespective user id should be included or\nexcluded from the result set.\nAccepts up to 100 user ids.\nAny user ids not found are ignored.", + "required": false, + }, + { + "name": "organization_id", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Returns users that have memberships to the\ngiven organizations.\nFor each organization id, the `+` and `-` can be\nprepended to the id, which denote whether the\nrespective organization should be included or\nexcluded from the result set.\nAccepts up to 100 organization ids.", + "required": false, + }, + { + "name": "query", + "in": "query", + "description": "Returns users that match the given query.\nFor possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.\nThe query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well.", + "schema": { + "type": "string" + }, + "required": false, + }, + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + { + "name": "order_by", + "in": "query", + "description": "Allows to return users in a particular order.\nAt the moment, you can order the returned users either by their `created_at` or `updated_at` timestamp.\nIn order to specify the direction, you can use the `+/-` symbols prepended in the property to order by.\nFor example, if you want users to be returned in descending order according to their `created_at` property, you can use `-created_at`.\nIf you don't use `+` or `-`, then `+` is implied.\nDefaults to `-created_at`.", + "schema": { + "type": "string", + "default": "-created_at" + }, + "required": false, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/User.List" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "post": { + "operationId": "CreateUser", + "summary": "Create a new user", + "description": "Creates a new user. Your user management settings determine how you should setup your user model.\n\nAny email address and phone number created using this method will be marked as verified.\n\nNote: If you are performing a migration, check out our guide on [zero downtime migrations](https://clerk.com/docs/deployments/import-users).\n\nA rate limit rule of 20 requests per 10 seconds is applied to this endpoint.", + "tags": [ + "Users" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "external_id": { + "type": "string", + "description": "The ID of the user as used in your external systems or your previous authentication solution.\nMust be unique across your instance.", + "nullable": true, + }, + "first_name": { + "type": "string", + "description": "The first name to assign to the user", + "nullable": true, + }, + "last_name": { + "type": "string", + "description": "The last name to assign to the user", + "nullable": true, + }, + "email_address": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Email addresses to add to the user.\nMust be unique across your instance.\nThe first email address will be set as the user's primary email address.", + }, + "phone_number": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Phone numbers to add to the user.\nMust be unique across your instance.\nThe first phone number will be set as the user's primary phone number.", + }, + "web3_wallet": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Web3 wallets to add to the user.\nMust be unique across your instance.\nThe first wallet will be set as the user's primary wallet.", + }, + "username": { + "type": "string", + "description": "The username to give to the user.\nIt must be unique across your instance.", + "nullable": true, + }, + "password": { + "type": "string", + "description": "The plaintext password to give the user.\nMust be at least 8 characters long, and can not be in any list of hacked passwords.", + "nullable": true, + }, + "password_digest": { + "type": "string", + "description": "In case you already have the password digests and not the passwords, you can use them for the newly created user via this property.\nThe digests should be generated with one of the supported algorithms.\nThe hashing algorithm can be specified using the `password_hasher` property.", + }, + "password_hasher": { + "type": "string", + "description": "The hashing algorithm that was used to generate the password digest.\nThe algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), md5, pbkdf2_sha256, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/) and 2 [argon2](https://argon2.online/) variants, argon2i and argon2id.\nEach of the above expects the incoming digest to be of a particular format.\n\nMore specifically:\n\n**bcrypt:** The digest should be of the following form:\n\n`$$$`\n\n**md5:** The digest should follow the regular form e.g.:\n\n`5f4dcc3b5aa765d61d8327deb882cf99`\n\n**pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows:\n\n`pbkdf2_sha256$$$`\n\nNote: Both the salt and the hash are expected to be base64-encoded.\n\n**pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django):\n\n`pbkdf2_sha256$$$`\n\nNote: The salt is expected to be un-encoded, the hash is expected base64-encoded.\n\n**pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences:\n1. uses sha1 instead of sha256\n2. accepts the hash as a hex-encoded string\n\nThe format is the following:\n\n`pbkdf2_sha1$$$`\n\n\n**scrypt_firebase:** The Firebase-specific variant of scrypt.\nThe value is expected to have 6 segments separated by the $ character and include the following information:\n\n_hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase.\n_salt:_ The salt used to generate the above hash. Again, this is given when exporting the user.\n_signer key:_ The base64 encoded signer key.\n_salt separator:_ The base64 encoded salt separator.\n_rounds:_ The number of rounds the algorithm needs to run.\n_memory cost:_ The cost of the algorithm run\n\nThe first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase.\nThe other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters.\n\nOnce you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it:\n\n`$$$$$`\n\n**argon2i:** Algorithms in the argon2 family generate digests that encode the following information:\n\n_version (v):_ The argon version, version 19 is assumed\n_memory (m):_ The memory used by the algorithm (in kibibytes)\n_iterations (t):_ The number of iterations to perform\n_parallelism (p):_ The number of threads to use\n\nParts are demarcated by the `$` character, with the first part identifying the algorithm variant.\nThe middle part is a comma-separated list of the encoding options (memory, iterations, parallelism).\nThe final part is the actual digest.\n\n`$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc`\n\n**argon2id:** See the previous algorithm for an explanation of the formatting.\n\nFor the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`:\n\n`$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU`\n\nIf you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support).", + "enum": [ + "bcrypt", + "md5", + "pbkdf2_sha256", + "pbkdf2_sha256_django", + "pbkdf2_sha1", + "scrypt_firebase", + "argon2i", + "argon2id", + ], + }, + "skip_password_checks": { + "type": "boolean", + "description": "When set to `true` all password checks are skipped.\nIt is recommended to use this method only when migrating plaintext passwords to Clerk.\nUpon migration the user base should be prompted to pick stronger password.", + }, + "skip_password_requirement": { + "type": "boolean", + "description": "When set to `true`, `password` is not required anymore when creating the user and can be omitted.\nThis is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords.\nPlease note that you cannot use this flag if password is the only way for a user to sign into your instance.", + }, + "totp_secret": { + "type": "string", + "description": "In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it.\nPlease note that currently the supported options are:\n* Period: 30 seconds\n* Code length: 6 digits\n* Algorithm: SHA1", + }, + "backup_codes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them.\nYou must provide the backup codes in plain format or the corresponding bcrypt digest.", + }, + "public_metadata": { + "type": "object", + "description": "Metadata saved on the user, that is visible to both your Frontend and Backend APIs", + }, + "private_metadata": { + "type": "object", + "description": "Metadata saved on the user, that is only visible to your Backend API", + }, + "unsafe_metadata": { + "type": "object", + "description": "Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.\nNote: Since this data can be modified from the frontend, it is not guaranteed to be safe.", + }, + "created_at": { + "type": "string", + "description": "A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/User" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/users/count": { + "get": { + "operationId": "GetUsersCount", + "summary": "Count users", + "description": "Returns a total count of all users that match the given filtering criteria.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "email_address", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Counts users with the specified email addresses.\nAccepts up to 100 email addresses.\nAny email addresses not found are ignored.", + "required": false, + }, + { + "name": "phone_number", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Counts users with the specified phone numbers.\nAccepts up to 100 phone numbers.\nAny phone numbers not found are ignored.", + "required": false, + }, + { + "name": "external_id", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Counts users with the specified external ids.\nAccepts up to 100 external ids.\nAny external ids not found are ignored.", + "required": false, + }, + { + "name": "username", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Counts users with the specified usernames.\nAccepts up to 100 usernames.\nAny usernames not found are ignored.", + "required": false, + }, + { + "name": "web3_wallet", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Counts users with the specified web3 wallet addresses.\nAccepts up to 100 web3 wallet addresses.\nAny web3 wallet addressed not found are ignored.", + "required": false, + }, + { + "name": "user_id", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Counts users with the user ids specified.\nAccepts up to 100 user ids.\nAny user ids not found are ignored.", + "required": false, + }, + { + "name": "query", + "in": "query", + "description": "Counts users that match the given query.\nFor possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.\nThe query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well.", + "schema": { + "type": "string" + }, + "required": false, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/User.Count" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/users/{user_id}": { + "get": { + "operationId": "GetUser", + "summary": "Retrieve a user", + "description": "Retrieve the details of a user", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user to retrieve", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/User" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "patch": { + "operationId": "UpdateUser", + "summary": "Update a user", + "description": "Update a user's attributes.\n\nYou can set the user's primary contact identifiers (email address and phone numbers) by updating the `primary_email_address_id` and `primary_phone_number_id` attributes respectively.\nBoth IDs should correspond to verified identifications that belong to the user.\n\nYou can remove a user's username by setting the username attribute to null or the blank string \"\".\nThis is a destructive action; the identification will be deleted forever.\nUsernames can be removed only if they are optional in your instance settings and there's at least one other identifier which can be used for authentication.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user to update", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "external_id": { + "type": "string", + "description": "The ID of the user as used in your external systems or your previous authentication solution.\nMust be unique across your instance.", + "nullable": true, + }, + "first_name": { + "type": "string", + "description": "The first name to assign to the user", + "nullable": true, + }, + "last_name": { + "type": "string", + "description": "The last name to assign to the user", + "nullable": true, + }, + "primary_email_address_id": { + "type": "string", + "description": "The ID of the email address to set as primary.\nIt must be verified, and present on the current user.", + }, + "primary_phone_number_id": { + "type": "string", + "description": "The ID of the phone number to set as primary.\nIt must be verified, and present on the current user.", + }, + "primary_web3_wallet_id": { + "type": "string", + "description": "The ID of the web3 wallets to set as primary.\nIt must be verified, and present on the current user.", + }, + "username": { + "type": "string", + "description": "The username to give to the user.\nIt must be unique across your instance.", + "nullable": true, + }, + "profile_image_id": { + "type": "string", + "description": "The ID of the image to set as the user's profile image", + "nullable": true, + }, + "password": { + "type": "string", + "description": "The plaintext password to give the user.\nMust be at least 8 characters long, and can not be in any list of hacked passwords.", + "nullable": true, + }, + "totp_secret": { + "type": "string", + "description": "In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.\nPlease note that currently the supported options are:\n* Period: 30 seconds\n* Code length: 6 digits\n* Algorithm: SHA1", + }, + "backup_codes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them.\nYou must provide the backup codes in plain format or the corresponding bcrypt digest.", + }, + "public_metadata": { + "type": "object", + "description": "Metadata saved on the user, that is visible to both your Frontend and Backend APIs", + }, + "private_metadata": { + "type": "object", + "description": "Metadata saved on the user, that is only visible to your Backend API", + }, + "unsafe_metadata": { + "type": "object", + "description": "Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.\nNote: Since this data can be modified from the frontend, it is not guaranteed to be safe.", + }, + "created_at": { + "type": "string", + "description": "A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/User" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "delete": { + "operationId": "DeleteUser", + "summary": "Delete a user", + "description": "Delete the specified user", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user to delete", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/users/{user_id}/ban": { + "post": { + "operationId": "BanUser", + "summary": "Ban a user", + "description": "Marks the given user as banned, which means that all their sessions are revoked and they are not allowed to sign in again.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user to ban", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/User" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + }, + }, + }, + "/users/{user_id}/unban": { + "post": { + "operationId": "UnbanUser", + "summary": "Unban a user", + "description": "Removes the ban mark from the given user.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user to unban", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/User" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + }, + }, + }, + "/users/{user_id}/metadata": { + "patch": { + "operationId": "UpdateUserMetadata", + "summary": "Merge and update a user's metadata", + "description": "Update a user's metadata attributes by merging existing values with the provided parameters.\n\nThis endpoint behaves differently than the *Update a user* endpoint.\nMetadata values will not be replaced entirely.\nInstead, a deep merge will be performed.\nDeep means that any nested JSON objects will be merged as well.\n\nYou can remove metadata keys at any level by setting their value to `null`.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user whose metadata will be updated and merged", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "public_metadata": { + "type": "object", + "description": "Metadata saved on the user, that is visible to both your frontend and backend.\nThe new object will be merged with the existing value.", + }, + "private_metadata": { + "type": "object", + "description": "Metadata saved on the user that is only visible to your backend.\nThe new object will be merged with the existing value.", + }, + "unsafe_metadata": { + "type": "object", + "description": "Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.\nThe new object will be merged with the existing value.\n\nNote: Since this data can be modified from the frontend, it is not guaranteed to be safe.", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/User" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/users/{user_id}/oauth_access_tokens/{provider}": { + "get": { + "operationId": "GetOAuthAccessToken", + "summary": "Retrieve the OAuth access token of a user", + "description": "Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider.\nFor OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user for which to retrieve the OAuth access token", + "required": true, + "schema": { + "type": "string" + }, + }, + { + "name": "provider", + "in": "path", + "description": "The ID of the OAuth provider (e.g. `oauth_google`)", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "description": "The OAuth access token of the user, if any.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string" + }, + "token": { + "type": "string", + "description": "The access token", + }, + "provider": { + "type": "string", + "description": "The ID of the provider", + }, + "public_metadata": { + "type": "object" + }, + "label": { + "type": "string", + "nullable": true, + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of scopes that the token is valid for.\nOnly present for OAuth 2.0 tokens.", + }, + "token_secret": { + "type": "string", + "description": "The token secret. Only present for OAuth 1.0 tokens.", + }, + }, + }, + }, + }, + }, + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/users/{user_id}/organization_memberships": { + "get": { + "operationId": "UsersGetOrganizationMemberships", + "summary": "Retrieve all memberships for a user", + "description": "Retrieve a paginated list of the user's organization memberships", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user whose organization memberships we want to retrieve", + "required": true, + "schema": { + "type": "string" + }, + }, + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationMemberships", + }, + "403": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/users/{user_id}/verify_password": { + "post": { + "operationId": "VerifyPassword", + "summary": "Verify the password of a user", + "description": "Check that the user's password matches the supplied input.\nUseful for custom auth flows and re-verification.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user for whom to verify the password", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "password": { + "type": "string", + "description": "The user password to verify", + }, + }, + "required": [ + "password" + ], + }, + }, + }, + }, + "responses": { + "200": { + "description": "The provided password was correct.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "verified": { + "type": "boolean", + "nullable": false, + }, + }, + }, + }, + }, + }, + "400": { + "description": "The user does not have a password set." + }, + "404": { + "description": "The user does not exist." + }, + "422": { + "description": "The provided password was incorrect." + }, + "500": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/users/{user_id}/verify_totp": { + "post": { + "operationId": "VerifyTOTP", + "summary": "Verify a TOTP or backup code for a user", + "description": "Verify that the provided TOTP or backup code is valid for the user.\nVerifying a backup code will result it in being consumed (i.e. it will\nbecome invalid).\nUseful for custom auth flows and re-verification.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user for whom to verify the TOTP", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "code": { + "type": "string", + "description": "The TOTP or backup code to verify", + }, + }, + "required": [ + "code" + ], + }, + }, + }, + }, + "responses": { + "200": { + "description": "The provided TOTP or backup code was correct.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "verified": { + "type": "boolean", + "nullable": false, + }, + "code_type": { + "type": "string", + "nullable": false, + "enum": [ + "totp", + "backup_code" + ], + }, + }, + }, + }, + }, + }, + "400": { + "description": "The user does not have TOTP configured for their account.", + }, + "404": { + "description": "The user does not exist." + }, + "422": { + "description": "The provided TOTP or backup code was incorrect.", + }, + "500": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/users/{user_id}/mfa": { + "delete": { + "operationId": "DisableMFA", + "summary": "Disable a user's MFA methods", + "description": "Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once.", + "tags": [ + "Users" + ], + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "The ID of the user whose MFA methods are to be disabled", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "user_id": { + "type": "string", + "nullable": false + }, + }, + }, + }, + }, + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "500": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/emails": { + "post": { + "operationId": "CreateEmail", + "summary": "Create an email", + "description": "Create and send an email to the supplied email address ID.", + "tags": [ + "Emails" + ], + "requestBody": { + "description": "Required parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "from_email_name": { + "type": "string", + "description": "The email name portion of the sending email address.\n
e.g.: `from_email_name=info` will send from info@example.com", + }, + "subject": { + "type": "string", + "description": "The subject of the email.", + "nullable": true, + }, + "body": { + "type": "string", + "description": "The body of the email.", + "nullable": true, + }, + "email_address_id": { + "type": "string", + "nullable": true, + "description": "The ID of the email address to send to.", + }, + "template_slug": { + "type": "string", + "nullable": true, + "description": "The slug of the template to use for sending this email", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Email" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/sms_messages": { + "post": { + "operationId": "CreateSMSMessage", + "summary": "Create an SMS message", + "description": "Create and send an SMS message to the supplied phone number ID", + "tags": [ + "SMS Messages" + ], + "requestBody": { + "description": "Required parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "message": { + "type": "string", + "description": "The message you would like to send", + "nullable": true, + }, + "phone_number_id": { + "type": "string", + "description": "The ID of a verified phone number the SMS message should be sent to", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/SMSMessage" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/invitations": { + "post": { + "operationId": "CreateInvitation", + "summary": "Create an invitation", + "description": "Creates a new invitation for the given email address and sends the invitation email.\nKeep in mind that you cannot create an invitation if there is already one for the given email address.\nAlso, trying to create an invitation for an email address that already exists in your application will result to an error.", + "tags": [ + "Invitations" + ], + "requestBody": { + "description": "Required parameters", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "email_address": { + "type": "string", + "description": "The email address the invitation will be sent to", + }, + "public_metadata": { + "type": "object", + "description": "Metadata that will be attached to the newly created invitation.\nThe value of this property should be a well-formed JSON object.\nOnce the user accepts the invitation and signs up, these metadata will end up in the user's public metadata.", + }, + "redirect_url": { + "type": "string", + "description": "Optional URL which specifies where to redirect the user once they click the invitation link.\nThis is only required if you have implemented a [custom flow](https://clerk.com/docs/authentication/invitations#custom-flow) and you're not using Clerk Hosted Pages or Clerk Components.", + }, + }, + "required": [ + "email_address" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Invitation" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "get": { + "summary": "List all invitations", + "description": "Returns all non-revoked invitations for your application, sorted by creation date", + "operationId": "ListInvitations", + "parameters": [ + { + "in": "query", + "name": "status", + "description": "Filter invitations based on their status", + "required": false, + "schema": { + "type": "string", + "enum": [ + "pending", + "accepted", + "revoked" + ], + }, + }, + ], + "tags": [ + "Invitations" + ], + "responses": { + "200": { + "$ref": "#/components/responses/Invitation.List" + } + }, + }, + }, + "/invitations/{invitation_id}/revoke": { + "post": { + "operationId": "RevokeInvitation", + "summary": "Revokes an invitation", + "description": "Revokes the given invitation.\nRevoking an invitation will prevent the user from using the invitation link that was sent to them.\nHowever, it doesn't prevent the user from signing up if they follow the sign up flow.\nOnly active (i.e. non-revoked) invitations can be revoked.", + "tags": [ + "Invitations" + ], + "parameters": [ + { + "name": "invitation_id", + "in": "path", + "description": "The ID of the invitation to be revoked", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Invitation" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/allowlist_identifiers": { + "get": { + "operationId": "ListAllowlistIdentifiers", + "summary": "List all identifiers on the allow-list", + "description": "Get a list of all identifiers allowed to sign up to an instance", + "tags": [ + "Allow-list / Block-list" + ], + "responses": { + "200": { + "$ref": "#/components/responses/AllowlistIdentifier.List", + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + }, + }, + "post": { + "operationId": "CreateAllowlistIdentifier", + "summary": "Add identifier to the allow-list", + "description": "Create an identifier allowed to sign up to an instance", + "tags": [ + "Allow-list / Block-list" + ], + "responses": { + "200": { + "$ref": "#/components/responses/AllowlistIdentifier" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/allowlist_identifiers/{identifier_id}": { + "delete": { + "operationId": "DeleteAllowlistIdentifier", + "summary": "Delete identifier from allow-list", + "description": "Delete an identifier from the instance allow-list", + "tags": [ + "Allow-list / Block-list" + ], + "parameters": [ + { + "name": "identifier_id", + "in": "path", + "description": "The ID of the identifier to delete from the allow-list", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/blocklist_identifiers": { + "get": { + "operationId": "ListBlocklistIdentifiers", + "summary": "List all identifiers on the block-list", + "description": "Get a list of all identifiers which are not allowed to access an instance", + "tags": [ + "Allow-list / Block-list" + ], + "responses": { + "200": { + "$ref": "#/components/responses/BlocklistIdentifier.List", + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + }, + }, + "post": { + "operationId": "CreateBlocklistIdentifier", + "summary": "Add identifier to the block-list", + "description": "Create an identifier that is blocked from accessing an instance", + "tags": [ + "Allow-list / Block-list" + ], + "responses": { + "200": { + "$ref": "#/components/responses/BlocklistIdentifier" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/blocklist_identifiers/{identifier_id}": { + "delete": { + "operationId": "DeleteBlocklistIdentifier", + "summary": "Delete identifier from block-list", + "description": "Delete an identifier from the instance block-list", + "tags": [ + "Allow-list / Block-list" + ], + "parameters": [ + { + "name": "identifier_id", + "in": "path", + "description": "The ID of the identifier to delete from the block-list", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/beta_features/instance_settings": { + "patch": { + "operationId": "UpdateInstanceAuthConfig", + "summary": "Update instance settings", + "description": "Updates the settings of an instance", + "tags": [ + "Beta Features" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "restricted_to_allowlist": { + "type": "boolean", + "description": "Whether sign up is restricted to email addresses, phone numbers and usernames that are on the allowlist.", + "nullable": true, + "default": false, + }, + "from_email_address": { + "type": "string", + "description": "The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent.\nOnly alphanumeric values are allowed.\nNote that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`).", + "nullable": true, + }, + "progressive_sign_up": { + "type": "boolean", + "description": "Enable the Progressive Sign Up algorithm. Refer to the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) for more info.", + "nullable": true, + }, + "session_token_template": { + "type": "string", + "description": "The name of the JWT Template used to augment your session tokens. To disable this, pass an empty string.", + "nullable": true, + }, + "enhanced_email_deliverability": { + "type": "boolean", + "description": "The \"enhanced_email_deliverability\" feature will send emails from \"verifications@clerk.dev\" instead of your domain.\nThis can be helpful if you do not have a high domain reputation.", + "nullable": true, + }, + "test_mode": { + "type": "boolean", + "description": "Toggles test mode for this instance, allowing the use of test email addresses and phone numbers.\nDefaults to true for development instances.", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/InstanceSettings" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/beta_features/domain": { + "put": { + "operationId": "UpdateProductionInstanceDomain", + "summary": "Update production instance domain", + "description": "Change the domain of a production instance.\n\nChanging the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code.\n\nWARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur.", + "tags": [ + "Beta Features" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "home_url": { + "type": "string", + "description": "The new home URL of the production instance e.g. https://www.example.com", + }, + }, + }, + }, + }, + }, + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "422": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/actor_tokens": { + "post": { + "summary": "Create actor token", + "description": "Create an actor token that can be used to impersonate the given user.", + "operationId": "CreateActorToken", + "tags": [ + "Actor Tokens" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "user_id": { + "type": "string", + "description": "The ID of the user that can use the newly created sign in token.", + }, + "actor": { + "type": "object", + "description": "The actor payload. It needs to include a sub property which should contain the ID of the actor.\nThis whole payload will be also included in the JWT session token.", + }, + "expires_in_seconds": { + "type": "integer", + "description": "Optional parameter to specify the life duration of the actor token in seconds.\nBy default, the duration is 1 hour.", + "default": 3600, + }, + "session_max_duration_in_seconds": { + "type": "integer", + "description": "The maximum duration that the session which will be created by the generated actor token should last.\nBy default, the duration of a session created via an actor token, lasts 30 minutes.", + "default": 1800, + }, + }, + "required": [ + "user_id", + "actor" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/ActorToken" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/actor_tokens/{actor_token_id}/revoke": { + "post": { + "summary": "Revoke actor token", + "description": "Revokes a pending actor token.", + "operationId": "RevokeActorToken", + "tags": [ + "Actor Tokens" + ], + "parameters": [ + { + "name": "actor_token_id", + "in": "path", + "description": "The ID of the actor token to be revoked.", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/ActorToken" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/instance": { + "patch": { + "operationId": "UpdateInstance", + "summary": "Update instance settings", + "description": "Updates the settings of an instance", + "tags": [ + "Instance Settings" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "test_mode": { + "type": "boolean", + "description": "Toggles test mode for this instance, allowing the use of test email addresses and phone numbers.\nDefaults to true for development instances.", + "nullable": true, + }, + "hibp": { + "type": "boolean", + "description": "Whether the instance should be using the HIBP service to check passwords for breaches", + "nullable": true, + }, + "enhanced_email_deliverability": { + "type": "boolean", + "description": "The \"enhanced_email_deliverability\" feature will send emails from \"verifications@clerk.dev\" instead of your domain.\nThis can be helpful if you do not have a high domain reputation.", + "nullable": true, + }, + "support_email": { + "type": "string", + "nullable": true + }, + "clerk_js_version": { + "type": "string", + "nullable": true + }, + "development_origin": { + "type": "string", + "nullable": true + }, + "experimental_allowed_origins": { + "type": "array", + "items": { + "type": "string" + }, + "deprecated": true, + }, + "allowed_origins": { + "type": "array", + "items": { + "type": "string" + }, + }, + "cookieless_dev": { + "type": "boolean", + "description": "Whether the instance should operate in cookieless development mode (i.e. without third-party cookies).\nDeprecated: Please use `url_based_session_syncing` instead.", + "deprecated": true, + }, + "url_based_session_syncing": { + "type": "boolean", + "description": "Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies).", + }, + }, + }, + }, + }, + }, + "responses": { + "204": { + "description": "Accepted" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/instance/restrictions": { + "patch": { + "operationId": "UpdateInstanceRestrictions", + "summary": "Update instance restrictions", + "description": "Updates the restriction settings of an instance", + "tags": [ + "Instance Settings" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowlist": { + "type": "boolean", + "nullable": true + }, + "blocklist": { + "type": "boolean", + "nullable": true + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/InstanceRestrictions" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + }, + }, + }, + "/instance/organization_settings": { + "patch": { + "operationId": "UpdateInstanceOrganizationSettings", + "summary": "Update instance organization settings", + "description": "Updates the organization settings of the instance", + "tags": [ + "Instance Settings" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean", + "nullable": true + }, + "max_allowed_memberships": { + "type": "integer", + "nullable": true + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationSettings" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/webhooks/svix": { + "post": { + "operationId": "CreateSvixApp", + "summary": "Create a Svix app", + "description": "Create a Svix app and associate it with the current instance", + "tags": [ + "Webhooks" + ], + "responses": { + "200": { + "$ref": "#/components/responses/SvixURL" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + "delete": { + "operationId": "DeleteSvixApp", + "summary": "Delete a Svix app", + "description": "Delete a Svix app and disassociate it from the current instance", + "tags": [ + "Webhooks" + ], + "responses": { + "204": { + "description": "Svix app was successfully deleted" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/webhooks/svix_url": { + "post": { + "operationId": "GenerateSvixAuthURL", + "summary": "Create a Svix Dashboard URL", + "description": "Generate a new url for accessing the Svix's management dashboard for that particular instance", + "tags": [ + "Webhooks" + ], + "responses": { + "200": { + "$ref": "#/components/responses/SvixURL" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/jwt_templates": { + "get": { + "summary": "List all templates", + "operationId": "ListJWTTemplates", + "tags": [ + "JWT Templates" + ], + "responses": { + "200": { + "$ref": "#/components/responses/JWTTemplate.List" + }, + }, + }, + "post": { + "operationId": "CreateJWTTemplate", + "summary": "Create a JWT template", + "description": "Create a new JWT template", + "tags": [ + "JWT Templates" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "JWT template name", + "nullable": false, + }, + "claims": { + "type": "object", + "description": "JWT template claims in JSON format", + "nullable": false, + }, + "lifetime": { + "type": "number", + "minimum": 30, + "maximum": 315360000, + "description": "JWT token lifetime", + "nullable": true, + }, + "allowed_clock_skew": { + "type": "number", + "minimum": 0, + "maximum": 300, + "description": "JWT token allowed clock skew", + "nullable": true, + }, + "custom_signing_key": { + "type": "boolean", + "description": "Whether a custom signing key/algorithm is also provided for this template", + "nullable": false, + }, + "signing_algorithm": { + "type": "string", + "description": "The custom signing algorithm to use when minting JWTs", + "nullable": true, + }, + "signing_key": { + "type": "string", + "description": "The custom signing private key to use when minting JWTs", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/JWTTemplate" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/jwt_templates/{template_id}": { + "get": { + "operationId": "GetJWTTemplate", + "summary": "Retrieve a template", + "description": "Retrieve the details of a given JWT template", + "tags": [ + "JWT Templates" + ], + "parameters": [ + { + "name": "template_id", + "in": "path", + "description": "JWT Template ID", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/JWTTemplate" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "patch": { + "operationId": "UpdateJWTTemplate", + "summary": "Update a JWT template", + "description": "Updates an existing JWT template", + "tags": [ + "JWT Templates" + ], + "parameters": [ + { + "name": "template_id", + "in": "path", + "description": "The ID of the JWT template to update", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "JWT template name", + "nullable": false, + }, + "claims": { + "type": "object", + "description": "JWT template claims in JSON format", + "nullable": false, + }, + "lifetime": { + "type": "number", + "minimum": 30, + "maximum": 315360000, + "description": "JWT token lifetime", + "nullable": true, + }, + "allowed_clock_skew": { + "type": "number", + "minimum": 0, + "maximum": 300, + "description": "JWT token allowed clock skew", + "nullable": true, + }, + "custom_signing_key": { + "type": "boolean", + "description": "Whether a custom signing key/algorithm is also provided for this template", + "nullable": false, + }, + "signing_algorithm": { + "type": "string", + "description": "The custom signing algorithm to use when minting JWTs", + "nullable": true, + }, + "signing_key": { + "type": "string", + "description": "The custom signing private key to use when minting JWTs", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/JWTTemplate" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "402": { + "$ref": "#/components/responses/PaymentRequired" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "delete": { + "operationId": "DeleteJWTTemplate", + "summary": "Delete a Template", + "description": "", + "tags": [ + "JWT Templates" + ], + "parameters": [ + { + "name": "template_id", + "in": "path", + "description": "JWT Template ID", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/organizations": { + "get": { + "operationId": "ListOrganizations", + "summary": "Get a list of organizations for an instance", + "description": "This request returns the list of organizations for an instance.\nResults can be paginated using the optional `limit` and `offset` query parameters.\nThe organizations are ordered by descending creation date.\nMost recent organizations will be returned first.", + "tags": [ + "Organizations" + ], + "parameters": [ + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + { + "in": "query", + "required": false, + "name": "include_members_count", + "description": "Flag to denote whether the member counts of each organization should be included in the response or not.", + "schema": { + "type": "boolean" + }, + }, + { + "in": "query", + "required": false, + "name": "query", + "description": "Returns organizations with ID, name, or slug that match the given query.\nUses exact match for organization ID and partial match for name and slug.", + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Organizations" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "post": { + "operationId": "CreateOrganization", + "summary": "Create an organization", + "description": "Creates a new organization with the given name for an instance.\nIn order to successfully create an organization you need to provide the ID of the User who will become the organization administrator.\nYou can specify an optional slug for the new organization.\nIf provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\".\nOrganization slugs must be unique for the instance.\nYou can provide additional metadata for the organization and set any custom attribute you want.\nOrganizations support private and public metadata.\nPrivate metadata can only be accessed from the Backend API.\nPublic metadata can be accessed from the Backend API, and are read-only from the Frontend API.", + "tags": [ + "Organizations" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the new organization", + }, + "created_by": { + "type": "string", + "description": "The ID of the User who will become the administrator for the new organization", + }, + "private_metadata": { + "type": "object", + "description": "Metadata saved on the organization, accessible only from the Backend API", + }, + "public_metadata": { + "type": "object", + "description": "Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API", + }, + "slug": { + "type": "string", + "description": "A slug for the new organization.\nCan contain only lowercase alphanumeric characters and the dash \"-\".\nMust be unique for the instance.", + }, + "max_allowed_memberships": { + "type": "integer", + "description": "The maximum number of memberships allowed for this organization", + }, + }, + "required": [ + "name", + "created_by" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Organization" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/organizations/{organization_id}": { + "get": { + "operationId": "GetOrganization", + "summary": "Retrieve an organization by ID or slug", + "description": "Fetches the organization whose ID or slug matches the provided `id_or_slug` URL query parameter.", + "tags": [ + "Organizations" + ], + "parameters": [ + { + "in": "path", + "name": "organization_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID or slug of the organization", + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/Organization" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "patch": { + "operationId": "UpdateOrganization", + "summary": "Update an organization", + "description": "Updates an existing organization", + "tags": [ + "Organizations" + ], + "parameters": [ + { + "in": "path", + "name": "organization_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the organization to update", + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "public_metadata": { + "type": "object", + "description": "Metadata saved on the organization, that is visible to both your frontend and backend.", + }, + "private_metadata": { + "type": "object", + "description": "Metadata saved on the organization that is only visible to your backend.", + }, + "name": { + "type": "string", + "description": "The new name of the organization", + "nullable": true, + }, + "slug": { + "type": "string", + "description": "The new slug of the organization, which needs to be unique in the instance", + "nullable": true, + }, + "max_allowed_memberships": { + "type": "integer", + "description": "The maximum number of memberships allowed for this organization", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Organization" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "delete": { + "operationId": "DeleteOrganization", + "summary": "Delete an organization", + "description": "Deletes the given organization.\nPlease note that deleting an organization will also delete all memberships and invitations.\nThis is not reversible.", + "tags": [ + "Organizations" + ], + "parameters": [ + { + "in": "path", + "name": "organization_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the organization to delete", + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/organizations/{organization_id}/metadata": { + "patch": { + "operationId": "MergeOrganizationMetadata", + "summary": "Merge and update metadata for an organization", + "description": "Update organization metadata attributes by merging existing values with the provided parameters.\nMetadata values will be updated via a deep merge.\nDeep meaning that any nested JSON objects will be merged as well.\nYou can remove metadata keys at any level by setting their value to `null`.", + "tags": [ + "Organizations" + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "description": "The ID of the organization for which metadata will be merged or updated", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "public_metadata": { + "type": "object", + "description": "Metadata saved on the organization, that is visible to both your frontend and backend.\nThe new object will be merged with the existing value.", + }, + "private_metadata": { + "type": "object", + "description": "Metadata saved on the organization that is only visible to your backend.\nThe new object will be merged with the existing value.", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/Organization" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/organizations/{organization_id}/logo": { + "put": { + "operationId": "UploadOrganizationLogo", + "summary": "Upload a logo for the organization", + "description": "Set or replace an organization's logo, by uploading an image file.\nThis endpoint uses the `multipart/form-data` request content type and accepts a file of image type.\nThe file size cannot exceed 10MB.\nOnly the following file content types are supported: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/x-icon`, `image/vnd.microsoft.icon`.", + "tags": [ + "Organizations" + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "description": "The ID of the organization for which to upload a logo", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "uploader_user_id": { + "type": "string" + }, + "file": { + "type": "string", + "format": "binary" + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationWithLogo" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "413": { + "$ref": "#/components/responses/ClerkErrors" + }, + }, + }, + }, + "/organizations/{organization_id}/invitations": { + "post": { + "operationId": "CreateOrganizationInvitation", + "summary": "Create and send an organization invitation", + "description": "Creates a new organization invitation and sends an email to the provided `email_address` with a link to accept the invitation and join the organization.\nYou can specify the `role` for the invited organization member.\n\nNew organization invitations get a \"pending\" status until they are revoked by an organization administrator or accepted by the invitee.\n\nThe request body supports passing an optional `redirect_url` parameter.\nWhen the invited user clicks the link to accept the invitation, they will be redirected to the URL provided.\nUse this parameter to implement a custom invitation acceptance flow.\n\nYou must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter.\nThat user must be a member with administrator privileges in the organization.\nOnly \"admin\" members can create organization invitations.\n\nYou can optionally provide public metadata for the organization invitation.\nThese metadata are visible by both the Frontend and the Backend.\nWhen the organization invitation is accepted, the metadata will be transferred to the newly created organization membership.", + "tags": [ + "Organization Invitations" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The ID of the organization for which to send the invitation", + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "email_address": { + "type": "string", + "description": "The email address of the new member that is going to be invited to the organization", + }, + "inviter_user_id": { + "type": "string", + "description": "The ID of the user that invites the new member to the organization.\nMust be an administrator in the organization.", + }, + "role": { + "type": "string", + "description": "The role of the new member in the organization", + "enum": [ + "admin", + "basic_member" + ], + }, + "public_metadata": { + "type": "object", + "description": "Metadata saved on the organization invitation, read-only from the Frontend API and fully accessible (read/write) from the Backend API.", + }, + "redirect_url": { + "type": "string", + "description": "Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email.", + }, + }, + "required": [ + "email_address", + "inviter_user_id", + "role" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationInvitation" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/organizations/{organization_id}/invitations/pending": { + "get": { + "operationId": "ListPendingOrganizationInvitations", + "summary": "Get a list of pending organization invitations", + "description": "This request returns the list of organization invitations with \"pending\" status.\nThese are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet.\nResults can be paginated using the optional `limit` and `offset` query parameters.\nThe organization invitations are ordered by descending creation date.\nMost recent invitations will be returned first.", + "tags": [ + "Organization Invitations" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The organization ID.", + }, + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationInvitations", + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/organizations/{organization_id}/invitations/{invitation_id}/revoke": { + "post": { + "operationId": "RevokeOrganizationInvitation", + "summary": "Revoke a pending organization invitation", + "description": "Use this request to revoke a previously issued organization invitation.\nRevoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation.\nOnly organization invitations with \"pending\" status can be revoked.\nThe request needs the `requesting_user_id` parameter to specify the user which revokes the invitation.\nOnly users with \"admin\" role can revoke invitations.", + "tags": [ + "Organization Invitations" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The organization ID.", + }, + { + "in": "path", + "required": true, + "name": "invitation_id", + "schema": { + "type": "string" + }, + "description": "The organization invitation ID.", + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "requesting_user_id": { + "type": "string", + "description": "The ID of the user that revokes the invitation.\nMust be an administrator in the organization.", + }, + }, + "required": [ + "requesting_user_id" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationInvitation" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/organizations/{organization_id}/memberships": { + "post": { + "operationId": "CreateOrganizationMembership", + "summary": "Create a new organization membership", + "description": "Adds a user as a member to the given organization.\nOnly users in the same instance as the organization can be added as members.", + "tags": [ + "Organization Memberships" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The ID of the organization where the new membership will be created", + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { + "type": "string", + "description": "The ID of the user that will be added as a member in the organization.\nThe user needs to exist in the same instance as the organization and must not be a member of the given organization already.", + }, + "role": { + "type": "string", + "description": "The role that the new member will have in the organization.", + "enum": [ + "admin", + "basic_member" + ], + }, + }, + "required": [ + "user_id", + "role" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationMembership" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "get": { + "operationId": "ListOrganizationMemberships", + "summary": "Get a list of all members of an organization", + "description": "Retrieves all user memberships for the given organization", + "tags": [ + "Organization Memberships" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The organization ID.", + }, + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationMemberships", + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/organizations/{organization_id}/memberships/{user_id}": { + "patch": { + "operationId": "UpdateOrganizationMembership", + "summary": "Update an organization membership", + "description": "Updates the properties of an existing organization membership", + "tags": [ + "Organization Memberships" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The ID of the organization the membership belongs to", + }, + { + "in": "path", + "required": true, + "name": "user_id", + "schema": { + "type": "string" + }, + "description": "The ID of the user that this membership belongs to", + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "The new role of the given membership.", + "enum": [ + "admin", + "basic_member" + ], + }, + }, + "required": [ + "role" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationMembership" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "delete": { + "operationId": "DeleteOrganizationMembership", + "summary": "Remove a member from an organization", + "description": "Removes the given membership from the organization", + "tags": [ + "Organization Memberships" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The ID of the organization the membership belongs to", + }, + { + "in": "path", + "required": true, + "name": "user_id", + "schema": { + "type": "string" + }, + "description": "The ID of the user that this membership belongs to", + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationMembership" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "401": { + "$ref": "#/components/responses/AuthenticationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/organizations/{organization_id}/memberships/{user_id}/metadata": { + "patch": { + "operationId": "UpdateOrganizationMembershipMetadata", + "summary": "Merge and update organization membership metadata", + "description": "Update an organization membership's metadata attributes by merging existing values with the provided parameters.\nMetadata values will be updated via a deep merge. Deep means that any nested JSON objects will be merged as well.\nYou can remove metadata keys at any level by setting their value to `null`.", + "tags": [ + "Organization Memberships" + ], + "parameters": [ + { + "in": "path", + "required": true, + "name": "organization_id", + "schema": { + "type": "string" + }, + "description": "The ID of the organization the membership belongs to", + }, + { + "in": "path", + "required": true, + "name": "user_id", + "schema": { + "type": "string" + }, + "description": "The ID of the user that this membership belongs to", + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "public_metadata": { + "type": "object", + "description": "Metadata saved on the organization membership, that is visible to both your frontend and backend.\nThe new object will be merged with the existing value.", + }, + "private_metadata": { + "type": "object", + "description": "Metadata saved on the organization membership that is only visible to your backend.\nThe new object will be merged with the existing value.", + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OrganizationMembership" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/redirect_urls": { + "get": { + "summary": "List all redirect URLs", + "description": "Lists all whitelisted redirect_urls for the instance", + "operationId": "ListRedirectURLs", + "tags": [ + "Redirect URLs" + ], + "responses": { + "200": { + "$ref": "#/components/responses/RedirectURL.List" + }, + }, + }, + "post": { + "description": "Create a redirect URL", + "operationId": "CreateRedirectURL", + "tags": [ + "Redirect URLs" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": 'The full url value prefixed with `https: //` or a custom scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"`', + "nullable": false, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/RedirectURL" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/redirect_urls/{id}": { + "get": { + "summary": "Retrieve a redirect URL", + "description": "Retrieve the details of the redirect URL with the given ID", + "operationId": "GetRedirectURL", + "tags": [ + "Redirect URLs" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the redirect URL", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/RedirectURL" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "delete": { + "summary": "Delete a redirect URL", + "description": "Remove the selected redirect URL from the whitelist of the instance", + "operationId": "DeleteRedirectURL", + "tags": [ + "Redirect URLs" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the redirect URL", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/sign_in_tokens": { + "post": { + "summary": "Create sign-in token", + "description": "Creates a new sign-in token and associates it with the given user.\nBy default, sign-in tokens expire in 30 days.\nYou can optionally supply a different duration in seconds using the `expires_in_seconds` property.", + "operationId": "CreateSignInToken", + "tags": [ + "Sign-in Tokens" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user_id": { + "type": "string", + "description": "The ID of the user that can use the newly created sign in token", + }, + "expires_in_seconds": { + "type": "integer", + "description": "Optional parameter to specify the life duration of the sign in token in seconds.\nBy default, the duration is 30 days.", + "default": 2592000, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/SignInToken" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/sign_in_tokens/{sign_in_token_id}/revoke": { + "post": { + "summary": "Revoke the given sign-in token", + "description": "Revokes a pending sign-in token", + "operationId": "RevokeSignInToken", + "tags": [ + "Sign-in Tokens" + ], + "parameters": [ + { + "name": "sign_in_token_id", + "in": "path", + "description": "The ID of the sign-in token to be revoked", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/SignInToken" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/sign_ups/{id}": { + "patch": { + "operationId": "UpdateSignUp", + "summary": "Update a sign-up", + "description": "Update the sign-up with the given ID", + "tags": [ + "Sign-ups" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the sign-up to update", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "custom_action": { + "type": "boolean", + "description": "Specifies whether a custom action has run for this sign-up attempt.\nThis is important when your instance has been configured to require a custom action to run before converting a sign-up into a user.\nAfter executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`.", + }, + "external_id": { + "type": "string", + "description": "The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution.\nThis will be copied to the resulting user when the sign-up is completed.", + "nullable": true, + }, + }, + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/SignUp" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + }, + }, + }, + "/oauth_applications": { + "get": { + "operationId": "ListOAuthApplications", + "summary": "Get a list of OAuth applications for an instance", + "description": "This request returns the list of OAuth applications for an instance.\nResults can be paginated using the optional `limit` and `offset` query parameters.\nThe OAuth applications are ordered by descending creation date.\nMost recent OAuth applications will be returned first.", + "tags": [ + "OAuth Applications" + ], + "parameters": [ + { + "$ref": "#/components/parameters/LimitParameter" + }, + { + "$ref": "#/components/parameters/OffsetParameter" + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/OAuthApplications" + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "post": { + "operationId": "CreateOAuthApplication", + "summary": "Create an OAuth application", + "description": "Creates a new OAuth application with the given name and callback URL for an instance.\nThe callback URL must be a valid url.\nAll URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc...", + "tags": [ + "OAuth Applications" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the new OAuth application", + }, + "callback_url": { + "type": "string", + "description": "The callback URL of the new OAuth application", + }, + }, + "required": [ + "name", + "callback_url" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OAuthApplicationWithSecret", + }, + "400": { + "$ref": "#/components/responses/ClerkErrors" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + }, + "/oauth_applications/{oauth_application_id}": { + "get": { + "operationId": "GetOAuthApplication", + "summary": "Retrieve an OAuth application by ID", + "description": "Fetches the OAuth application whose ID matches the provided `id` in the path.", + "tags": [ + "OAuth Applications" + ], + "parameters": [ + { + "in": "path", + "name": "oauth_application_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the OAuth application", + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/OAuthApplication" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + "patch": { + "operationId": "UpdateOAuthApplication", + "summary": "Update an OAuth application", + "description": "Updates an existing OAuth application", + "tags": [ + "OAuth Applications" + ], + "parameters": [ + { + "in": "path", + "name": "oauth_application_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the OAuth application to update", + }, + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The new name of the OAuth application", + }, + "callback_url": { + "type": "string", + "description": "The new callback URL of the OAuth application", + }, + }, + "required": [ + "name", + "callback_url" + ], + }, + }, + }, + }, + "responses": { + "200": { + "$ref": "#/components/responses/OAuthApplication" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + "422": { + "$ref": "#/components/responses/UnprocessableEntity" + }, + }, + }, + "delete": { + "operationId": "DeleteOAuthApplication", + "summary": "Delete an OAuth application", + "description": "Deletes the given OAuth application.\nThis is not reversible.", + "tags": [ + "OAuth Applications" + ], + "parameters": [ + { + "in": "path", + "name": "oauth_application_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the OAuth application to delete", + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/DeletedObject" + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + "/oauth_applications/{oauth_application_id}/rotate_secret": { + "post": { + "operationId": "RotateOAuthApplicationSecret", + "summary": "Rotate the client secret of the given OAuth application", + "description": "Rotates the OAuth application's client secret.\nWhen the client secret is rotated, make sure to update it in authorized OAuth clients.", + "tags": [ + "OAuth Applications" + ], + "parameters": [ + { + "name": "oauth_application_id", + "in": "path", + "description": "The ID of the OAuth application for which to rotate the client secret", + "required": true, + "schema": { + "type": "string" + }, + }, + ], + "responses": { + "200": { + "$ref": "#/components/responses/OAuthApplicationWithSecret", + }, + "403": { + "$ref": "#/components/responses/AuthorizationInvalid" + }, + "404": { + "$ref": "#/components/responses/ResourceNotFound" + }, + }, + }, + }, + }, +} \ No newline at end of file diff --git a/swagger/clerk.yaml b/swagger/clerk.yaml new file mode 100644 index 0000000..d9f9568 --- /dev/null +++ b/swagger/clerk.yaml @@ -0,0 +1,5349 @@ +--- +openapi: 3.0.3 +info: + title: Clerk Backend API + x-logo: + url: https://clerk.com/_next/image?url=%2Fimages%2Fclerk-logo.svg&w=96&q=75 + altText: Clerk docs + href: https://clerk.com/docs + contact: + email: support@clerk.com + name: Clerk Platform Team + url: https://clerk.com/support + description: + The Clerk REST Backend API, meant to be accessed by backend servers. + Please see https://clerk.com/docs for more information. + version: v1 + termsOfService: https://clerk.com/terms + license: + name: MIT + url: https://github.com/clerkinc/clerk-sdk-go/blob/main/LICENSE +externalDocs: + url: https://clerk.com/docs +servers: + - url: https://api.clerk.dev/v1 + - url: https://api.clerk.com/v1 +security: + - bearerAuth: [] +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + parameters: + LimitParameter: + name: limit + in: query + description: |- + Applies a limit to the number of results returned. + Can be used for paginating the results together with `offset`. + Must be an integer greater than zero and less than 500. + By default, if not supplied, a limit of 10 is used. + required: false + schema: + type: number + default: 10 + minimum: 1 + maximum: 500 + OffsetParameter: + name: offset + in: query + description: |- + Skip the first `offset` results when paginating. + Needs to be an integer greater or equal to zero. + To be used in conjunction with `limit`. + required: false + schema: + type: number + default: 0 + minimum: 0 + schemas: + Session: + type: object + additionalProperties: false + properties: + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - session + id: + type: string + user_id: + type: string + client_id: + type: string + actor: + type: object + nullable: true + status: + type: string + enum: + - active + - revoked + - ended + - expired + - removed + - abandoned + last_active_organization_id: + type: string + nullable: true + last_active_at: + type: integer + expire_at: + type: integer + abandon_at: + type: integer + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + required: + - object + - id + - user_id + - client_id + - status + - last_active_at + - expire_at + - abandon_at + - updated_at + - created_at + Client: + type: object + additionalProperties: false + properties: + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - client + id: + type: string + description: "String representing the identifier of the session. + + " + session_ids: + type: array + items: + type: string + sessions: + type: array + items: + "$ref": "#/components/schemas/Session" + sign_in_attempt_id: + type: string + nullable: true + deprecated: true + sign_up_attempt_id: + type: string + nullable: true + deprecated: true + sign_in_id: + type: string + nullable: true + sign_up_id: + type: string + nullable: true + last_active_session_id: + nullable: true + type: string + description: "Last active session_id. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + required: + - object + - id + - session_ids + - sessions + - sign_in_attempt_id + - sign_up_attempt_id + - sign_in_id + - sign_up_id + - last_active_session_id + - updated_at + - created_at + ClerkError: + type: object + properties: + message: + type: string + long_message: + type: string + code: + type: string + meta: + type: object + required: + - message + - long_message + - code + ClerkErrors: + type: object + properties: + errors: + type: array + items: + "$ref": "#/components/schemas/ClerkError" + meta: + type: object + required: + - errors + OTP: + type: object + additionalProperties: false + properties: + status: + type: string + enum: + - unverified + - verified + - failed + - expired + strategy: + type: string + enum: + - phone_code + - email_code + attempts: + type: integer + expire_at: + type: integer + required: + - status + - attempts + - strategy + - expire_at + Admin: + type: object + additionalProperties: false + properties: + status: + type: string + enum: + - verified + strategy: + type: string + enum: + - admin + attempts: + type: integer + nullable: true + expire_at: + type: integer + nullable: true + required: + - status + - strategy + IdentificationLink: + type: object + additionalProperties: false + properties: + type: + type: string + enum: + - oauth_google + - oauth_mock + id: + type: string + required: + - type + - id + EmailAddress: + type: object + additionalProperties: false + properties: + id: + type: string + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - email_address + email_address: + type: string + reserved: + type: boolean + verification: + type: object + nullable: true + oneOf: + - "$ref": "#/components/schemas/OTP" + - "$ref": "#/components/schemas/Admin" + linked_to: + type: array + items: + "$ref": "#/components/schemas/IdentificationLink" + required: + - object + - email_address + - verification + - linked_to + - reserved + DeletedObject: + type: object + additionalProperties: false + properties: + object: + type: string + id: + type: string + slug: + type: string + deleted: + type: boolean + required: + - object + - deleted + PhoneNumber: + type: object + additionalProperties: false + properties: + id: + type: string + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - phone_number + phone_number: + type: string + reserved_for_second_factor: + type: boolean + default_second_factor: + type: boolean + reserved: + type: boolean + verification: + type: object + nullable: true + oneOf: + - "$ref": "#/components/schemas/OTP" + - "$ref": "#/components/schemas/Admin" + linked_to: + type: array + items: + "$ref": "#/components/schemas/IdentificationLink" + backup_codes: + type: array + items: + type: string + nullable: true + required: + - object + - phone_number + - verification + - linked_to + - reserved + Template: + type: object + additionalProperties: false + properties: + id: + type: string + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - template + instance_id: + nullable: true + type: string + description: the id of the instance the template belongs to + resource_type: + type: string + description: whether this is a system (default) or user overridden) template + template_type: + type: string + description: whether this is an email or SMS template + name: + type: string + description: user-friendly name of the template + slug: + type: string + description: machine-friendly name of the template + position: + type: integer + description: position with the listing of templates + can_revert: + type: boolean + description: + whether this template can be reverted to the corresponding + system default + can_delete: + type: boolean + description: whether this template can be deleted + subject: + type: string + description: email subject + nullable: true + markup: + type: string + description: the editor markup used to generate the body of the template + body: + type: string + description: the template body before variable interpolation + available_variables: + type: array + description: + list of variables that are available for use in the template + body + items: + type: string + required_variables: + type: array + description: list of variables that must be contained in the template body + items: + type: string + from_email_name: + type: string + delivered_by_clerk: + type: boolean + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + Web3Signature: + type: object + additionalProperties: false + properties: + status: + type: string + enum: + - verified + strategy: + type: string + enum: + - web3_metamask_signature + nonce: + type: string + enum: + - nonce + attempts: + type: integer + nullable: true + expire_at: + type: integer + nullable: true + required: + - status + - strategy + - nonce + Web3Wallet: + type: object + additionalProperties: false + properties: + id: + type: string + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - web3_wallet + web3_wallet: + type: string + verification: + type: object + nullable: true + oneOf: + - "$ref": "#/components/schemas/Web3Signature" + - "$ref": "#/components/schemas/Admin" + required: + - object + - web3_wallet + - verification + User: + type: object + additionalProperties: false + properties: + id: + type: string + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - user + external_id: + nullable: true + type: string + primary_email_address_id: + nullable: true + type: string + primary_phone_number_id: + nullable: true + type: string + primary_web3_wallet_id: + nullable: true + type: string + username: + nullable: true + type: string + first_name: + nullable: true + type: string + last_name: + nullable: true + type: string + profile_image_url: + type: string + deprecated: true + image_url: + type: string + public_metadata: + type: object + private_metadata: + nullable: true + type: object + unsafe_metadata: + type: object + gender: + nullable: true + type: string + birthday: + nullable: true + type: string + email_addresses: + type: array + items: + "$ref": "#/components/schemas/EmailAddress" + phone_numbers: + type: array + items: + "$ref": "#/components/schemas/PhoneNumber" + web3_wallets: + type: array + items: + "$ref": "#/components/schemas/Web3Wallet" + password_enabled: + type: boolean + two_factor_enabled: + type: boolean + totp_enabled: + type: boolean + backup_code_enabled: + type: boolean + external_accounts: + type: array + items: + type: object + last_sign_in_at: + type: integer + format: int64 + nullable: true + description: "Unix timestamp of last sign-in. + + " + banned: + type: boolean + description: "Flag to denote whether user is banned or not. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + TotalCount: + type: object + additionalProperties: false + properties: + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - total_count + total_count: + type: integer + format: int64 + required: + - object + - total_count + Organization: + type: object + properties: + object: + type: string + enum: + - organization + id: + type: string + name: + type: string + slug: + type: string + members_count: + type: integer + nullable: true + max_allowed_memberships: + type: integer + public_metadata: + type: object + private_metadata: + type: object + created_by: + type: string + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + required: + - object + - id + - name + - slug + - max_allowed_memberships + - public_metadata + - private_metadata + - created_at + - updated_at + OrganizationMembership: + description: Hello world + type: object + properties: + id: + type: string + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - organization_membership + role: + type: string + enum: + - admin + - basic_member + created_at: + type: integer + format: int64 + description: Unix timestamp of creation. + updated_at: + type: integer + format: int64 + description: Unix timestamp of last update. + organization: + type: object + nullable: false + allOf: + - "$ref": "#/components/schemas/Organization" + public_user_data: + type: object + additionalProperties: false + properties: + user_id: + type: string + nullable: false + first_name: + type: string + nullable: true + last_name: + type: string + nullable: true + profile_image_url: + type: string + nullable: true + deprecated: true + image_url: + type: string + nullable: true + identifier: + type: string + nullable: true + OrganizationMemberships: + type: object + additionalProperties: false + properties: + data: + type: array + items: + "$ref": "#/components/schemas/OrganizationMembership" + total_count: + type: integer + format: int64 + description: "Total number of organization memberships + + " + required: + - data + - total_count + Email: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - email + id: + type: string + slug: + type: string + nullable: true + from_email_name: + type: string + email_address_id: + type: string + nullable: true + to_email_address: + type: string + user_id: + type: string + nullable: true + subject: + type: string + body: + type: string + body_plain: + type: string + nullable: true + status: + type: string + data: + type: object + nullable: true + delivered_by_clerk: + type: boolean + required: + - object + - id + - from_email_name + - email_address_id + - to_email_address + - subject + - body + - status + - delivered_by_clerk + SMSMessage: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - sms_message + id: + type: string + slug: + type: string + nullable: true + from_phone_number: + type: string + to_phone_number: + type: string + phone_number_id: + type: string + nullable: true + user_id: + type: string + nullable: true + message: + type: string + status: + type: string + data: + type: object + nullable: true + delivered_by_clerk: + type: boolean + required: + - object + - id + - from_phone_number + - to_phone_number + - phone_number_id + - message + - status + - delivered_by_clerk + Invitation: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - invitation + id: + type: string + email_address: + type: string + format: email + public_metadata: + type: object + revoked: + type: boolean + example: true + status: + type: string + enum: + - pending + - accepted + - revoked + example: revoked + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + required: + - object + - id + - email_address + - status + - created_at + - updated_at + AllowlistIdentifier: + type: object + additionalProperties: false + properties: + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - allowlist_identifier + id: + type: string + invitation_id: + type: string + identifier: + type: string + description: "An email address or a phone number. + + " + identifier_type: + type: string + enum: + - email_address + - phone_number + - web3_wallet + instance_id: + type: string + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + BlocklistIdentifier: + type: object + additionalProperties: false + properties: + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - blocklist_identifier + id: + type: string + identifier: + type: string + description: + "An email address, email domain, phone number or web3 wallet. + + " + identifier_type: + type: string + enum: + - email_address + - phone_number + - web3_wallet + instance_id: + type: string + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + BlocklistIdentifiers: + type: object + additionalProperties: false + properties: + data: + type: array + items: + "$ref": "#/components/schemas/BlocklistIdentifier" + total_count: + type: integer + format: int64 + description: "Total number of blocklist identifiers + + " + required: + - data + - total_count + ActorToken: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - actor_token + id: + type: string + status: + type: string + enum: + - pending + - accepted + - revoked + user_id: + type: string + actor: + type: object + token: + type: string + nullable: true + url: + type: string + nullable: true + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + required: + - object + - id + - user_id + - actor + - status + - created_at + - updated_at + InstanceRestrictions: + type: object + properties: + object: + type: string + description: + String representing the object's type. Objects of the same + type share the same value. + enum: + - instance_restrictions + allowlist: + type: boolean + blocklist: + type: boolean + OrganizationSettings: + type: object + properties: + object: + type: string + description: + String representing the object's type. Objects of the same + type share the same value. + enum: + - organization_settings + enabled: + type: boolean + max_allowed_memberships: + type: integer + required: + - object + - enabled + - max_allowed_memberships + SvixURL: + type: object + additionalProperties: false + properties: + svix_url: + type: string + required: + - svix_url + JWTTemplate: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - jwt_template + id: + type: string + name: + type: string + claims: + type: object + lifetime: + type: integer + allowed_clock_skew: + type: integer + custom_signing_key: + type: boolean + signing_algorithm: + type: string + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + required: + - object + - id + - name + - claims + - lifetime + - allowed_clock_skew + - created_at + - updated_at + Organizations: + type: object + additionalProperties: false + properties: + data: + type: array + items: + "$ref": "#/components/schemas/Organization" + total_count: + type: integer + format: int64 + description: "Total number of organizations + + " + required: + - data + - total_count + OrganizationWithLogo: + type: object + allOf: + - "$ref": "#/components/schemas/Organization" + - type: object + properties: + logo_url: + type: string + deprecated: true + image_url: + type: string + required: + - logo_url + - image_url + OrganizationInvitation: + description: An organization invitation + type: object + properties: + id: + type: string + object: + type: string + description: + "String representing the object's type. Objects of the same + type share the same value. + + " + enum: + - organization_invitation + email_address: + type: string + role: + type: string + enum: + - admin + - basic_member + organization_id: + type: string + status: + type: string + created_at: + type: integer + format: int64 + description: Unix timestamp of creation. + updated_at: + type: integer + format: int64 + description: Unix timestamp of last update. + OrganizationInvitations: + type: object + additionalProperties: false + properties: + data: + type: array + items: + "$ref": "#/components/schemas/OrganizationInvitation" + total_count: + type: integer + format: int64 + description: "Total number of organization invitations + + " + required: + - data + - total_count + RedirectURL: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - redirect_url + id: + type: string + url: + type: string + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + required: + - object + - id + - url + - created_at + - updated_at + SignInToken: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - sign_in_token + id: + type: string + status: + type: string + enum: + - pending + - accepted + - revoked + user_id: + type: string + token: + type: string + url: + type: string + nullable: true + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + required: + - object + - id + - user_id + - status + - created_at + - updated_at + SignUp: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - sign_up_attempt + id: + type: string + status: + type: string + enum: + - missing_requirements + - complete + - abandoned + required_fields: + type: array + items: + type: string + optional_fields: + type: array + items: + type: string + missing_fields: + type: array + items: + type: string + unverified_fields: + type: array + items: + type: string + verifications: + type: object + username: + type: string + nullable: true + email_address: + type: string + nullable: true + phone_number: + type: string + nullable: true + web3_wallet: + type: string + nullable: true + password_enabled: + type: boolean + first_name: + type: string + nullable: true + last_name: + type: string + nullable: true + unsafe_metadata: + type: object + public_metadata: + type: object + custom_action: + type: boolean + external_id: + type: string + nullable: true + created_session_id: + type: string + nullable: true + created_user_id: + type: string + nullable: true + abandon_at: + type: integer + identification_requirements: + type: array + items: + type: array + items: + type: string + missing_requirements: + type: array + items: + type: string + email_address_verification: + type: object + nullable: true + deprecated: true + phone_number_verification: + type: object + nullable: true + deprecated: true + external_account_strategy: + type: string + nullable: true + external_account_verification: + type: object + nullable: true + deprecated: true + external_account: + type: object + required: + - object + - id + - status + - password_enabled + - custom_action + - abandon_at + OAuthApplication: + type: object + properties: + object: + type: string + enum: + - oauth_application + id: + type: string + instance_id: + type: string + name: + type: string + client_id: + type: string + scopes: + type: string + callback_url: + type: string + authorize_url: + type: string + token_fetch_url: + type: string + user_info_url: + type: string + created_at: + type: integer + format: int64 + description: "Unix timestamp of creation. + + " + updated_at: + type: integer + format: int64 + description: "Unix timestamp of last update. + + " + required: + - object + - id + - instance_id + - name + - client_id + - scopes + - callback_url + - authorize_url + - token_fetch_url + - user_info_url + - created_at + - updated_at + OAuthApplications: + type: object + additionalProperties: false + properties: + data: + type: array + items: + "$ref": "#/components/schemas/OAuthApplication" + total_count: + type: integer + format: int64 + description: "Total number of OAuth applications + + " + required: + - data + - total_count + OAuthApplicationWithSecret: + allOf: + - "$ref": "#/components/schemas/OAuthApplication" + - type: object + properties: + client_secret: + type: string + required: + - client_secret + responses: + Client.List: + description: Success + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/Client" + ClerkErrors: + description: Request was not successful + content: + application/json: + schema: + "$ref": "#/components/schemas/ClerkErrors" + AuthenticationInvalid: + description: Authentication invalid + content: + application/json: + schema: + "$ref": "#/components/schemas/ClerkErrors" + UnprocessableEntity: + description: Invalid request parameters + content: + application/json: + schema: + "$ref": "#/components/schemas/ClerkErrors" + Client: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/Client" + ResourceNotFound: + description: Resource not found + content: + application/json: + schema: + "$ref": "#/components/schemas/ClerkErrors" + Session: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/Session" + EmailAddress: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/EmailAddress" + AuthorizationInvalid: + description: Authorization invalid + content: + application/json: + schema: + "$ref": "#/components/schemas/ClerkErrors" + DeletedObject: + description: Deleted Object + content: + application/json: + schema: + "$ref": "#/components/schemas/DeletedObject" + PhoneNumber: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/PhoneNumber" + Session.List: + description: Success + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/Session" + Template.List: + description: Success + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/Template" + Template: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/Template" + PaymentRequired: + description: Payment required + content: + application/json: + schema: + "$ref": "#/components/schemas/ClerkErrors" + User.List: + description: Success + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/User" + User: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/User" + User.Count: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/TotalCount" + OrganizationMemberships: + description: A list of organization memberships + content: + application/json: + schema: + "$ref": "#/components/schemas/OrganizationMemberships" + Email: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/Email" + SMSMessage: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/SMSMessage" + Invitation.List: + description: List of invitations + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/Invitation" + Invitation: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/Invitation" + AllowlistIdentifier.List: + description: Success + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/AllowlistIdentifier" + AllowlistIdentifier: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/AllowlistIdentifier" + BlocklistIdentifier.List: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/BlocklistIdentifiers" + BlocklistIdentifier: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/BlocklistIdentifier" + InstanceSettings: + description: InstanceSettings Server API + content: + application/json: + schema: + type: object + properties: + object: + type: string + description: + String representing the object's type. Objects of the + same type share the same value. + enum: + - instance_settings + id: + type: string + restricted_to_allowlist: + type: boolean + from_email_address: + type: string + progressive_sign_up: + type: boolean + enhanced_email_deliverability: + type: boolean + ActorToken: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/ActorToken" + InstanceRestrictions: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/InstanceRestrictions" + OrganizationSettings: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/OrganizationSettings" + SvixURL: + description: + Response that contains a temporary Svix URL to access management + dashboard + content: + application/json: + schema: + "$ref": "#/components/schemas/SvixURL" + JWTTemplate.List: + description: List of JWT templates + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/JWTTemplate" + JWTTemplate: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/JWTTemplate" + Organizations: + description: A list of organizations + content: + application/json: + schema: + "$ref": "#/components/schemas/Organizations" + Organization: + description: An organization + content: + application/json: + schema: + "$ref": "#/components/schemas/Organization" + OrganizationWithLogo: + description: An organization with a logo URL. + content: + application/json: + schema: + "$ref": "#/components/schemas/OrganizationWithLogo" + OrganizationInvitation: + description: An organization invitation + content: + application/json: + schema: + "$ref": "#/components/schemas/OrganizationInvitation" + OrganizationInvitations: + description: A list of organization invitations + content: + application/json: + schema: + "$ref": "#/components/schemas/OrganizationInvitations" + OrganizationMembership: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/OrganizationMembership" + RedirectURL.List: + description: List of Redirect URLs + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/RedirectURL" + RedirectURL: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/RedirectURL" + SignInToken: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/SignInToken" + SignUp: + description: Success + content: + application/json: + schema: + "$ref": "#/components/schemas/SignUp" + OAuthApplications: + description: A list of OAuth applications + content: + application/json: + schema: + "$ref": "#/components/schemas/OAuthApplications" + OAuthApplicationWithSecret: + description: An OAuth application with client secret + content: + application/json: + schema: + "$ref": "#/components/schemas/OAuthApplicationWithSecret" + OAuthApplication: + description: An OAuth application + content: + application/json: + schema: + "$ref": "#/components/schemas/OAuthApplication" +tags: + - name: Actor Tokens + description: Allow your users to sign in on behalf of other users. + externalDocs: + url: https://clerk.com/docs/authentication/user-impersonation#actor-tokens + - name: Allow-list / Block-list + description: |- + Allow-lists and Block-lists allow you to control who can sign up or sign in + to your application, by restricting access based on the user's email + address or phone number. + externalDocs: + url: https://clerk.com/docs/authentication/allowlist + - name: Clients + description: + The Client object tracks sessions, as well as the state of any sign + in and sign up attempts, for a given device. + externalDocs: + url: https://clerk.com/docs/reference/clerkjs/client + - name: Email Addresses + description: + A user can be associated with one or more email addresses and allows + them to be contacted via email. + externalDocs: + url: https://clerk.com/docs/reference/clerkjs/emailaddress + - name: Emails + description: |- + The email object represents an email that has been sent to an email address. + You can only send an email to email addresses that have been verified by a user. + Only recommended for transactional emails. + - name: Email & SMS Templates + description: + Email & SMS templates allow you to customize the theming and wording + of emails & SMS messages that are sent by your instance. + externalDocs: + url: https://clerk.com/docs/authentication/email-sms-templates + - name: Instance Settings + description: Modify the settings of your instance. + - name: Invitations + description: + Invitations allow you to invite someone to sign up to your application, + via email. + externalDocs: + url: https://clerk.com/docs/authentication/invitations + - name: JWKS + description: + Retrieve the JSON Web Key Set which can be used to verify the token + signatures of the instance. + - name: JWT Templates + description: |- + JWT Templates allow you to generate custom authentication tokens + tied to authenticated sessions, enabling you to integrate with third-party + services. + externalDocs: + url: https://clerk.com/docs/request-authentication/jwt-templates + - name: OAuth Applications + description: + OAuth applications contain data for clients using Clerk as an OAuth2 + identity provider. + - name: Organizations + description: + Organizations are used to group members under a common entity and provide + shared access to resources. + externalDocs: + url: https://clerk.com/docs/organizations/overview + - name: Organization Invitations + description: Invite users to an organization. + externalDocs: + url: https://clerk.com/docs/organizations/invite-users + - name: Organization Memberships + description: Manage member roles in an organization. + externalDocs: + url: https://clerk.com/docs/organizations/manage-member-roles + - name: Phone Numbers + description: + A user can be associated with one or more email addresses and allows + them to be contacted via SMS. + externalDocs: + url: https://clerk.com/docs/reference/clerkjs/phonenumber + - name: Redirect URLs + description: |- + Redirect URLs are whitelisted URLs that facilitate secure authentication flows in native applications (e.g. React Native, Expo). + In these contexts, Clerk ensures that security-critical nonces are passed only to the whitelisted URLs. + - name: Sessions + description: |- + The Session object is an abstraction over an HTTP session. + It models the period of information exchange between a user and the server. + Sessions are created when a user successfully goes through the sign in or sign up flows. + externalDocs: + url: https://clerk.com/docs/reference/clerkjs/session + - name: Sign-in Tokens + description: |- + Sign-in tokens are JWTs that can be used to sign in to an application without specifying any credentials. + A sign-in token can be used at most once and they can be consumed from the Frontend API using the `ticket` strategy. + - name: SMS Messages + description: |- + SMS messages can be sent to verified phone numbers that belong to users. + This functionality is only recommended for transactional SMS messages. + - name: Users + description: + The user object represents a user that has successfully signed up to + your application. + externalDocs: + url: https://clerk.com/docs/reference/clerkjs/user + - name: Webhooks + description: + You can configure webhooks to be notified about various events that + happen on your instance. + externalDocs: + url: https://clerk.com/docs/integration/webhooks + - name: Miscellaneous + description: Various endpoints that do not belong in any particular category. + - name: Beta Features + description: Modify instance settings that are currently in beta. +paths: + "/public/demo_instance": + post: + security: [] + operationId: CreateDemoInstance + summary: Create a demo development instance + description: + Creates a demo development instance and returns the corresponding + Frontend/Backend API keys. + tags: + - Miscellaneous + responses: + "200": + description: The API keys of the created instance. + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + object: + type: string + enum: + - demo_dev_instance + frontend_api_key: + type: string + backend_api_key: + type: string + jwt_verification_key: + type: string + description: + The public key that can be used to verify the session + tokens of the created instance. + accounts_url: + type: string + description: + The URL of the hosted Accounts Portal of the created + instance. + format: uri + "/public/interstitial": + get: + security: [] + summary: Returns the markup for the interstitial page + description: |- + The Clerk interstitial endpoint serves an html page that loads clerk.js in order to check the user's authentication state. + It is used by Clerk SDKs when the user's authentication state cannot be immediately determined. + operationId: GetPublicInterstitial + tags: + - Miscellaneous + parameters: + - name: frontendApi + in: query + required: false + description: The Frontend API key of your instance + schema: + type: string + - name: publishable_key + in: query + required: false + description: The publishable key of your instance + schema: + type: string + responses: + "200": + description: The interstitial page markup + "400": + description: A required query parameter is missing + "/jwks": + get: + operationId: GetJWKS + summary: Retrieve the JSON Web Key Set of the instance + description: Retrieve the JSON Web Key Set of the instance + tags: + - JWKS + responses: + "200": + description: The JSON Web Key Set + "/clients": + get: + operationId: GetClientList + tags: + - Clients + summary: List all clients + description: |- + Returns a list of all clients. The clients are returned sorted by creation date, + with the newest clients appearing first. + parameters: + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + responses: + "200": + "$ref": "#/components/responses/Client.List" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/clients/verify": + post: + operationId: VerifyClient + tags: + - Clients + summary: Verify a client + description: Verifies the client in the provided token + requestBody: + description: Parameters. + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + token: + type: string + description: A JWT Token that represents the active client. + responses: + "200": + "$ref": "#/components/responses/Client" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/clients/{client_id}": + get: + operationId: GetClient + tags: + - Clients + summary: Get a client + description: Returns the details of a client. + parameters: + - name: client_id + in: path + description: Client ID. + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Client" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/clients/{client_id}/last_active_session": + get: + operationId: GetClientLastActiveSession + tags: + - Clients + summary: Get the last active session of a client + description: Returns the details of the last active session of a client. + parameters: + - name: client_id + in: path + description: Client ID. + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Session" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/email_addresses": + post: + operationId: CreateEmailAddress + tags: + - Email Addresses + summary: Create an email address + description: Create a new email address + requestBody: + content: + application/json: + schema: + type: object + properties: + user_id: + type: string + description: The ID representing the user + email_address: + type: string + description: + The new email address. Must adhere to the RFC 5322 + specification for email address format. + verified: + type: boolean + description: When created, the email address will be marked as verified. + nullable: true + primary: + type: boolean + description: |- + Create this email address as the primary email address for the user. + Default: false, unless it is the first email address. + nullable: true + responses: + "200": + "$ref": "#/components/responses/EmailAddress" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/email_addresses/{email_address_id}": + get: + operationId: GetEmailAddress + tags: + - Email Addresses + summary: Retrieve an email address + description: Returns the details of an email address. + parameters: + - name: email_address_id + in: path + description: The ID of the email address to retrieve + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/EmailAddress" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + delete: + operationId: DeleteEmailAddress + tags: + - Email Addresses + summary: Delete an email address + description: Delete the email address with the given ID + parameters: + - name: email_address_id + in: path + description: The ID of the email address to delete + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + patch: + operationId: UpdateEmailAddress + tags: + - Email Addresses + summary: Update an email address + description: Updates an email address. + parameters: + - name: email_address_id + in: path + description: The ID of the email address to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + verified: + type: boolean + description: The email address will be marked as verified. + nullable: true + primary: + type: boolean + description: + Set this email address as the primary email address + for the user. + nullable: true + responses: + "200": + "$ref": "#/components/responses/EmailAddress" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/phone_numbers": + post: + operationId: CreatePhoneNumber + tags: + - Phone Numbers + summary: Create a phone number + description: Create a new phone number + requestBody: + content: + application/json: + schema: + type: object + properties: + user_id: + type: string + description: The ID representing the user + phone_number: + type: string + description: + The new phone number. Must adhere to the E.164 standard + for phone number format. + verified: + type: boolean + description: When created, the phone number will be marked as verified. + nullable: true + primary: + type: boolean + description: |- + Create this phone number as the primary phone number for the user. + Default: false, unless it is the first phone number. + nullable: true + responses: + "200": + "$ref": "#/components/responses/PhoneNumber" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/phone_numbers/{phone_number_id}": + get: + operationId: GetPhoneNumber + tags: + - Phone Numbers + summary: Retrieve a phone number + description: Returns the details of a phone number + parameters: + - name: phone_number_id + in: path + description: The ID of the phone number to retrieve + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/PhoneNumber" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + delete: + operationId: DeletePhoneNumber + tags: + - Phone Numbers + summary: Delete a phone number + description: Delete the phone number with the given ID + parameters: + - name: phone_number_id + in: path + description: The ID of the phone number to delete + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + patch: + operationId: UpdatePhoneNumber + tags: + - Phone Numbers + summary: Update a phone number + description: Updates a phone number + parameters: + - name: phone_number_id + in: path + description: The ID of the phone number to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + verified: + type: boolean + description: The phone number will be marked as verified. + nullable: true + primary: + type: boolean + description: + Set this phone number as the primary phone number for + the user. + nullable: true + responses: + "200": + "$ref": "#/components/responses/PhoneNumber" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/sessions": + get: + operationId: GetSessionList + tags: + - Sessions + summary: List all sessions + description: |- + Returns a list of all sessions. + The sessions are returned sorted by creation date, with the newest sessions appearing first. + parameters: + - name: client_id + in: query + required: false + description: List sessions for the given client + schema: + type: string + - name: user_id + in: query + required: false + description: List sessions for the given user + schema: + type: string + - name: status + in: query + required: false + description: Filter sessions by the provided status + schema: + type: string + enum: + - abandoned + - active + - ended + - expired + - removed + - replaced + - revoked + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + responses: + "200": + "$ref": "#/components/responses/Session.List" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/sessions/{session_id}": + get: + operationId: GetSession + tags: + - Sessions + summary: Retrieve a session + description: Retrieve the details of a session + parameters: + - name: session_id + in: path + description: The ID of the session + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Session" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/sessions/{session_id}/revoke": + post: + operationId: RevokeSession + tags: + - Sessions + summary: Revoke a session + description: |- + Sets the status of a session as "revoked", which is an unauthenticated state. + In multi-session mode, a revoked session will still be returned along with its client object, however the user will need to sign in again. + parameters: + - name: session_id + in: path + description: The ID of the session + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Session" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/sessions/{session_id}/verify": + post: + operationId: VerifySession + tags: + - Sessions + summary: Verify a session + description: + Returns the session if it is authenticated, otherwise returns an + error. + parameters: + - name: session_id + in: path + description: The ID of the session + required: true + schema: + type: string + requestBody: + description: Parameters. + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + token: + type: string + description: |- + The JWT that is sent via the `__session` cookie from your frontend. + Note: this JWT must be associated with the supplied session ID. + responses: + "200": + "$ref": "#/components/responses/Session" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/sessions/{session_id}/tokens/{template_name}": + post: + operationId: CreateSessionTokenFromTemplate + tags: + - Sessions + summary: Create a session token from a jwt template + description: + Creates a JSON Web Token(JWT) based on a session and a JWT Template + name defined for your instance + parameters: + - name: session_id + in: path + description: The ID of the session + required: true + schema: + type: string + - name: template_name + in: path + description: The name of the JWT Template defined in your instance (e.g. `custom_hasura`). + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + object: + type: string + enum: + - token + jwt: + type: string + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/templates/{template_type}": + get: + operationId: GetTemplateList + summary: List all templates + description: |- + Returns a list of all templates. + The templates are returned sorted by position. + tags: + - Email & SMS Templates + parameters: + - name: template_type + in: path + description: The type of templates to list (email or SMS) + required: true + schema: + type: string + enum: + - email + - sms + responses: + "200": + "$ref": "#/components/responses/Template.List" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/templates/{template_type}/{slug}": + get: + operationId: GetTemplate + summary: Retrieve a template + description: Returns the details of a template + tags: + - Email & SMS Templates + parameters: + - name: template_type + in: path + description: The type of templates to retrieve (email or SMS) + required: true + schema: + type: string + enum: + - email + - sms + - name: slug + in: path + description: The slug (i.e. machine-friendly name) of the template to retrieve + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Template" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + put: + operationId: UpsertTemplate + summary: Update a template for a given type and slug + description: Updates the existing template of the given type and slug + tags: + - Email & SMS Templates + parameters: + - name: template_type + in: path + description: The type of template to update + required: true + schema: + type: string + enum: + - email + - sms + - name: slug + in: path + description: The slug of the template to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + name: + type: string + description: The user-friendly name of the template + subject: + type: string + description: |- + The email subject. + Applicable only to email templates. + nullable: true + markup: + type: string + description: + The editor markup used to generate the body of the + template + nullable: true + body: + type: string + description: The template body before variable interpolation + delivered_by_clerk: + type: boolean + description: + Whether Clerk should deliver emails or SMS messages + based on the current template + nullable: true + from_email_name: + type: string + description: |- + The local part of the From email address that will be used for emails. + For example, in the address 'hello@example.com', the local part is 'hello'. + Applicable only to email templates. + responses: + "200": + "$ref": "#/components/responses/Template" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "402": + "$ref": "#/components/responses/PaymentRequired" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/templates/{template_type}/{slug}/revert": + post: + operationId: RevertTemplate + summary: Revert a template + description: Reverts an updated template to its default state + tags: + - Email & SMS Templates + parameters: + - name: template_type + in: path + description: The type of template to revert + required: true + schema: + type: string + enum: + - email + - sms + - name: slug + in: path + description: The slug of the template to revert + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Template" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "402": + "$ref": "#/components/responses/PaymentRequired" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/templates/{template_type}/{slug}/preview": + post: + operationId: PreviewTemplate + summary: Preview changes to a template + description: + Returns a preview of a template for a given template_type, slug + and body + tags: + - Email & SMS Templates + parameters: + - name: template_type + in: path + description: The type of template to preview + required: true + schema: + type: string + - name: slug + in: path + description: The slug of the template to preview + required: true + schema: + type: string + requestBody: + description: Required parameters + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + subject: + type: string + description: |- + The email subject. + Applicable only to email templates. + nullable: true + body: + type: string + description: The template body before variable interpolation + from_email_name: + type: string + description: |- + The local part of the From email address that will be used for emails. + For example, in the address 'hello@example.com', the local part is 'hello'. + Applicable only to email templates. + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/users": + get: + operationId: GetUserList + summary: List all users + description: |- + Returns a list of all users. + The users are returned sorted by creation date, with the newest users appearing first. + tags: + - Users + parameters: + - name: email_address + in: query + schema: + type: array + items: + type: string + description: |- + Returns users with the specified email addresses. + Accepts up to 100 email addresses. + Any email addresses not found are ignored. + required: false + - name: phone_number + in: query + schema: + type: array + items: + type: string + description: |- + Returns users with the specified phone numbers. + Accepts up to 100 phone numbers. + Any phone numbers not found are ignored. + required: false + - name: external_id + in: query + schema: + type: array + items: + type: string + description: |- + Returns users with the specified external ids. + For each external id, the `+` and `-` can be + prepended to the id, which denote whether the + respective external id should be included or + excluded from the result set. + Accepts up to 100 external ids. + Any external ids not found are ignored. + required: false + - name: username + in: query + schema: + type: array + items: + type: string + description: |- + Returns users with the specified usernames. + Accepts up to 100 usernames. + Any usernames not found are ignored. + required: false + - name: web3_wallet + in: query + schema: + type: array + items: + type: string + description: |- + Returns users with the specified web3 wallet addresses. + Accepts up to 100 web3 wallet addresses. + Any web3 wallet addressed not found are ignored. + required: false + - name: user_id + in: query + schema: + type: array + items: + type: string + description: |- + Returns users with the user ids specified. + For each user id, the `+` and `-` can be + prepended to the id, which denote whether the + respective user id should be included or + excluded from the result set. + Accepts up to 100 user ids. + Any user ids not found are ignored. + required: false + - name: organization_id + in: query + schema: + type: array + items: + type: string + description: |- + Returns users that have memberships to the + given organizations. + For each organization id, the `+` and `-` can be + prepended to the id, which denote whether the + respective organization should be included or + excluded from the result set. + Accepts up to 100 organization ids. + required: false + - name: query + in: query + description: |- + Returns users that match the given query. + For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. + The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. + schema: + type: string + required: false + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + - name: order_by + in: query + description: |- + Allows to return users in a particular order. + At the moment, you can order the returned users either by their `created_at` or `updated_at` timestamp. + In order to specify the direction, you can use the `+/-` symbols prepended in the property to order by. + For example, if you want users to be returned in descending order according to their `created_at` property, you can use `-created_at`. + If you don't use `+` or `-`, then `+` is implied. + Defaults to `-created_at`. + schema: + type: string + default: "-created_at" + required: false + responses: + "200": + "$ref": "#/components/responses/User.List" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + post: + operationId: CreateUser + summary: Create a new user + description: |- + Creates a new user. Your user management settings determine how you should setup your user model. + + Any email address and phone number created using this method will be marked as verified. + + Note: If you are performing a migration, check out our guide on [zero downtime migrations](https://clerk.com/docs/deployments/import-users). + + A rate limit rule of 20 requests per 10 seconds is applied to this endpoint. + tags: + - Users + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + external_id: + type: string + description: |- + The ID of the user as used in your external systems or your previous authentication solution. + Must be unique across your instance. + nullable: true + first_name: + type: string + description: The first name to assign to the user + nullable: true + last_name: + type: string + description: The last name to assign to the user + nullable: true + email_address: + type: array + items: + type: string + description: |- + Email addresses to add to the user. + Must be unique across your instance. + The first email address will be set as the user's primary email address. + phone_number: + type: array + items: + type: string + description: |- + Phone numbers to add to the user. + Must be unique across your instance. + The first phone number will be set as the user's primary phone number. + web3_wallet: + type: array + items: + type: string + description: |- + Web3 wallets to add to the user. + Must be unique across your instance. + The first wallet will be set as the user's primary wallet. + username: + type: string + description: |- + The username to give to the user. + It must be unique across your instance. + nullable: true + password: + type: string + description: |- + The plaintext password to give the user. + Must be at least 8 characters long, and can not be in any list of hacked passwords. + nullable: true + password_digest: + type: string + description: |- + In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + The digests should be generated with one of the supported algorithms. + The hashing algorithm can be specified using the `password_hasher` property. + password_hasher: + type: string + description: |- + The hashing algorithm that was used to generate the password digest. + The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), md5, pbkdf2_sha256, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/) and 2 [argon2](https://argon2.online/) variants, argon2i and argon2id. + Each of the above expects the incoming digest to be of a particular format. + + More specifically: + + **bcrypt:** The digest should be of the following form: + + `$$$` + + **md5:** The digest should follow the regular form e.g.: + + `5f4dcc3b5aa765d61d8327deb882cf99` + + **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + + `pbkdf2_sha256$$$` + + Note: Both the salt and the hash are expected to be base64-encoded. + + **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + + `pbkdf2_sha256$$$` + + Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + + **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + 1. uses sha1 instead of sha256 + 2. accepts the hash as a hex-encoded string + + The format is the following: + + `pbkdf2_sha1$$$` + + + **scrypt_firebase:** The Firebase-specific variant of scrypt. + The value is expected to have 6 segments separated by the $ character and include the following information: + + _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + _signer key:_ The base64 encoded signer key. + _salt separator:_ The base64 encoded salt separator. + _rounds:_ The number of rounds the algorithm needs to run. + _memory cost:_ The cost of the algorithm run + + The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + + Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + + `$$$$$` + + **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + + _version (v):_ The argon version, version 19 is assumed + _memory (m):_ The memory used by the algorithm (in kibibytes) + _iterations (t):_ The number of iterations to perform + _parallelism (p):_ The number of threads to use + + Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + The final part is the actual digest. + + `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + + **argon2id:** See the previous algorithm for an explanation of the formatting. + + For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + + `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + + If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + enum: + - bcrypt + - md5 + - pbkdf2_sha256 + - pbkdf2_sha256_django + - pbkdf2_sha1 + - scrypt_firebase + - argon2i + - argon2id + skip_password_checks: + type: boolean + description: |- + When set to `true` all password checks are skipped. + It is recommended to use this method only when migrating plaintext passwords to Clerk. + Upon migration the user base should be prompted to pick stronger password. + skip_password_requirement: + type: boolean + description: |- + When set to `true`, `password` is not required anymore when creating the user and can be omitted. + This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + totp_secret: + type: string + description: |- + In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + Please note that currently the supported options are: + * Period: 30 seconds + * Code length: 6 digits + * Algorithm: SHA1 + backup_codes: + type: array + items: + type: string + description: |- + If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + You must provide the backup codes in plain format or the corresponding bcrypt digest. + public_metadata: + type: object + description: + Metadata saved on the user, that is visible to both + your Frontend and Backend APIs + private_metadata: + type: object + description: + Metadata saved on the user, that is only visible to + your Backend API + unsafe_metadata: + type: object + description: |- + Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + created_at: + type: string + description: + A custom date/time denoting _when_ the user signed + up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + responses: + "200": + "$ref": "#/components/responses/User" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/users/count": + get: + operationId: GetUsersCount + summary: Count users + description: + Returns a total count of all users that match the given filtering + criteria. + tags: + - Users + parameters: + - name: email_address + in: query + schema: + type: array + items: + type: string + description: |- + Counts users with the specified email addresses. + Accepts up to 100 email addresses. + Any email addresses not found are ignored. + required: false + - name: phone_number + in: query + schema: + type: array + items: + type: string + description: |- + Counts users with the specified phone numbers. + Accepts up to 100 phone numbers. + Any phone numbers not found are ignored. + required: false + - name: external_id + in: query + schema: + type: array + items: + type: string + description: |- + Counts users with the specified external ids. + Accepts up to 100 external ids. + Any external ids not found are ignored. + required: false + - name: username + in: query + schema: + type: array + items: + type: string + description: |- + Counts users with the specified usernames. + Accepts up to 100 usernames. + Any usernames not found are ignored. + required: false + - name: web3_wallet + in: query + schema: + type: array + items: + type: string + description: |- + Counts users with the specified web3 wallet addresses. + Accepts up to 100 web3 wallet addresses. + Any web3 wallet addressed not found are ignored. + required: false + - name: user_id + in: query + schema: + type: array + items: + type: string + description: |- + Counts users with the user ids specified. + Accepts up to 100 user ids. + Any user ids not found are ignored. + required: false + - name: query + in: query + description: |- + Counts users that match the given query. + For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. + The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. + schema: + type: string + required: false + responses: + "200": + "$ref": "#/components/responses/User.Count" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/users/{user_id}": + get: + operationId: GetUser + summary: Retrieve a user + description: Retrieve the details of a user + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user to retrieve + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/User" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + patch: + operationId: UpdateUser + summary: Update a user + description: |- + Update a user's attributes. + + You can set the user's primary contact identifiers (email address and phone numbers) by updating the `primary_email_address_id` and `primary_phone_number_id` attributes respectively. + Both IDs should correspond to verified identifications that belong to the user. + + You can remove a user's username by setting the username attribute to null or the blank string "". + This is a destructive action; the identification will be deleted forever. + Usernames can be removed only if they are optional in your instance settings and there's at least one other identifier which can be used for authentication. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user to update + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + external_id: + type: string + description: |- + The ID of the user as used in your external systems or your previous authentication solution. + Must be unique across your instance. + nullable: true + first_name: + type: string + description: The first name to assign to the user + nullable: true + last_name: + type: string + description: The last name to assign to the user + nullable: true + primary_email_address_id: + type: string + description: |- + The ID of the email address to set as primary. + It must be verified, and present on the current user. + primary_phone_number_id: + type: string + description: |- + The ID of the phone number to set as primary. + It must be verified, and present on the current user. + primary_web3_wallet_id: + type: string + description: |- + The ID of the web3 wallets to set as primary. + It must be verified, and present on the current user. + username: + type: string + description: |- + The username to give to the user. + It must be unique across your instance. + nullable: true + profile_image_id: + type: string + description: The ID of the image to set as the user's profile image + nullable: true + password: + type: string + description: |- + The plaintext password to give the user. + Must be at least 8 characters long, and can not be in any list of hacked passwords. + nullable: true + totp_secret: + type: string + description: |- + In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. + Please note that currently the supported options are: + * Period: 30 seconds + * Code length: 6 digits + * Algorithm: SHA1 + backup_codes: + type: array + items: + type: string + description: |- + If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. + You must provide the backup codes in plain format or the corresponding bcrypt digest. + public_metadata: + type: object + description: + Metadata saved on the user, that is visible to both + your Frontend and Backend APIs + private_metadata: + type: object + description: + Metadata saved on the user, that is only visible to + your Backend API + unsafe_metadata: + type: object + description: |- + Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + created_at: + type: string + description: + A custom date/time denoting _when_ the user signed + up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + responses: + "200": + "$ref": "#/components/responses/User" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + delete: + operationId: DeleteUser + summary: Delete a user + description: Delete the specified user + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user to delete + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/users/{user_id}/ban": + post: + operationId: BanUser + summary: Ban a user + description: + Marks the given user as banned, which means that all their sessions + are revoked and they are not allowed to sign in again. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user to ban + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/User" + "402": + "$ref": "#/components/responses/PaymentRequired" + "/users/{user_id}/unban": + post: + operationId: UnbanUser + summary: Unban a user + description: Removes the ban mark from the given user. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user to unban + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/User" + "402": + "$ref": "#/components/responses/PaymentRequired" + "/users/{user_id}/metadata": + patch: + operationId: UpdateUserMetadata + summary: Merge and update a user's metadata + description: |- + Update a user's metadata attributes by merging existing values with the provided parameters. + + This endpoint behaves differently than the *Update a user* endpoint. + Metadata values will not be replaced entirely. + Instead, a deep merge will be performed. + Deep means that any nested JSON objects will be merged as well. + + You can remove metadata keys at any level by setting their value to `null`. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user whose metadata will be updated and merged + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + public_metadata: + type: object + description: |- + Metadata saved on the user, that is visible to both your frontend and backend. + The new object will be merged with the existing value. + private_metadata: + type: object + description: |- + Metadata saved on the user that is only visible to your backend. + The new object will be merged with the existing value. + unsafe_metadata: + type: object + description: |- + Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + The new object will be merged with the existing value. + + Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + responses: + "200": + "$ref": "#/components/responses/User" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/users/{user_id}/oauth_access_tokens/{provider}": + get: + operationId: GetOAuthAccessToken + summary: Retrieve the OAuth access token of a user + description: |- + Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider. + For OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user for which to retrieve the OAuth access token + required: true + schema: + type: string + - name: provider + in: path + description: The ID of the OAuth provider (e.g. `oauth_google`) + required: true + schema: + type: string + responses: + "200": + description: The OAuth access token of the user, if any. + content: + application/json: + schema: + type: array + items: + type: object + additionalProperties: false + properties: + object: + type: string + token: + type: string + description: The access token + provider: + type: string + description: The ID of the provider + public_metadata: + type: object + label: + type: string + nullable: true + scopes: + type: array + items: + type: string + description: |- + The list of scopes that the token is valid for. + Only present for OAuth 2.0 tokens. + token_secret: + type: string + description: The token secret. Only present for OAuth 1.0 tokens. + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/users/{user_id}/organization_memberships": + get: + operationId: UsersGetOrganizationMemberships + summary: Retrieve all memberships for a user + description: Retrieve a paginated list of the user's organization memberships + tags: + - Users + parameters: + - name: user_id + in: path + description: + The ID of the user whose organization memberships we want to + retrieve + required: true + schema: + type: string + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + responses: + "200": + "$ref": "#/components/responses/OrganizationMemberships" + "403": + "$ref": "#/components/responses/ClerkErrors" + "/users/{user_id}/verify_password": + post: + operationId: VerifyPassword + summary: Verify the password of a user + description: |- + Check that the user's password matches the supplied input. + Useful for custom auth flows and re-verification. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user for whom to verify the password + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + password: + type: string + description: The user password to verify + required: + - password + responses: + "200": + description: The provided password was correct. + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + verified: + type: boolean + nullable: false + "400": + description: The user does not have a password set. + "404": + description: The user does not exist. + "422": + description: The provided password was incorrect. + "500": + "$ref": "#/components/responses/ClerkErrors" + "/users/{user_id}/verify_totp": + post: + operationId: VerifyTOTP + summary: Verify a TOTP or backup code for a user + description: |- + Verify that the provided TOTP or backup code is valid for the user. + Verifying a backup code will result it in being consumed (i.e. it will + become invalid). + Useful for custom auth flows and re-verification. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user for whom to verify the TOTP + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + code: + type: string + description: The TOTP or backup code to verify + required: + - code + responses: + "200": + description: The provided TOTP or backup code was correct. + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + verified: + type: boolean + nullable: false + code_type: + type: string + nullable: false + enum: + - totp + - backup_code + "400": + description: The user does not have TOTP configured for their account. + "404": + description: The user does not exist. + "422": + description: The provided TOTP or backup code was incorrect. + "500": + "$ref": "#/components/responses/ClerkErrors" + "/users/{user_id}/mfa": + delete: + operationId: DisableMFA + summary: Disable a user's MFA methods + description: + Disable all of a user's MFA methods (e.g. OTP sent via SMS, TOTP + on their authenticator app) at once. + tags: + - Users + parameters: + - name: user_id + in: path + description: The ID of the user whose MFA methods are to be disabled + required: true + schema: + type: string + responses: + "200": + description: Successful operation. + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + user_id: + type: string + nullable: false + "404": + "$ref": "#/components/responses/ResourceNotFound" + "500": + "$ref": "#/components/responses/ClerkErrors" + "/emails": + post: + operationId: CreateEmail + summary: Create an email + description: Create and send an email to the supplied email address ID. + tags: + - Emails + requestBody: + description: Required parameters + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + from_email_name: + type: string + description: |- + The email name portion of the sending email address. +
e.g.: `from_email_name=info` will send from info@example.com + subject: + type: string + description: The subject of the email. + nullable: true + body: + type: string + description: The body of the email. + nullable: true + email_address_id: + type: string + nullable: true + description: The ID of the email address to send to. + template_slug: + type: string + nullable: true + description: The slug of the template to use for sending this email + responses: + "200": + "$ref": "#/components/responses/Email" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/sms_messages": + post: + operationId: CreateSMSMessage + summary: Create an SMS message + description: Create and send an SMS message to the supplied phone number ID + tags: + - SMS Messages + requestBody: + description: Required parameters + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + message: + type: string + description: The message you would like to send + nullable: true + phone_number_id: + type: string + description: + The ID of a verified phone number the SMS message should + be sent to + responses: + "200": + "$ref": "#/components/responses/SMSMessage" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/invitations": + post: + operationId: CreateInvitation + summary: Create an invitation + description: |- + Creates a new invitation for the given email address and sends the invitation email. + Keep in mind that you cannot create an invitation if there is already one for the given email address. + Also, trying to create an invitation for an email address that already exists in your application will result to an error. + tags: + - Invitations + requestBody: + description: Required parameters + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + email_address: + type: string + description: The email address the invitation will be sent to + public_metadata: + type: object + description: |- + Metadata that will be attached to the newly created invitation. + The value of this property should be a well-formed JSON object. + Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. + redirect_url: + type: string + description: |- + Optional URL which specifies where to redirect the user once they click the invitation link. + This is only required if you have implemented a [custom flow](https://clerk.com/docs/authentication/invitations#custom-flow) and you're not using Clerk Hosted Pages or Clerk Components. + required: + - email_address + responses: + "200": + "$ref": "#/components/responses/Invitation" + "400": + "$ref": "#/components/responses/ClerkErrors" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + get: + summary: List all invitations + description: + Returns all non-revoked invitations for your application, sorted + by creation date + operationId: ListInvitations + parameters: + - in: query + name: status + description: Filter invitations based on their status + required: false + schema: + type: string + enum: + - pending + - accepted + - revoked + tags: + - Invitations + responses: + "200": + "$ref": "#/components/responses/Invitation.List" + "/invitations/{invitation_id}/revoke": + post: + operationId: RevokeInvitation + summary: Revokes an invitation + description: |- + Revokes the given invitation. + Revoking an invitation will prevent the user from using the invitation link that was sent to them. + However, it doesn't prevent the user from signing up if they follow the sign up flow. + Only active (i.e. non-revoked) invitations can be revoked. + tags: + - Invitations + parameters: + - name: invitation_id + in: path + description: The ID of the invitation to be revoked + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Invitation" + "400": + "$ref": "#/components/responses/ClerkErrors" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/allowlist_identifiers": + get: + operationId: ListAllowlistIdentifiers + summary: List all identifiers on the allow-list + description: Get a list of all identifiers allowed to sign up to an instance + tags: + - Allow-list / Block-list + responses: + "200": + "$ref": "#/components/responses/AllowlistIdentifier.List" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "402": + "$ref": "#/components/responses/PaymentRequired" + post: + operationId: CreateAllowlistIdentifier + summary: Add identifier to the allow-list + description: Create an identifier allowed to sign up to an instance + tags: + - Allow-list / Block-list + responses: + "200": + "$ref": "#/components/responses/AllowlistIdentifier" + "400": + "$ref": "#/components/responses/ClerkErrors" + "402": + "$ref": "#/components/responses/PaymentRequired" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/allowlist_identifiers/{identifier_id}": + delete: + operationId: DeleteAllowlistIdentifier + summary: Delete identifier from allow-list + description: Delete an identifier from the instance allow-list + tags: + - Allow-list / Block-list + parameters: + - name: identifier_id + in: path + description: The ID of the identifier to delete from the allow-list + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "402": + "$ref": "#/components/responses/PaymentRequired" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/blocklist_identifiers": + get: + operationId: ListBlocklistIdentifiers + summary: List all identifiers on the block-list + description: + Get a list of all identifiers which are not allowed to access an + instance + tags: + - Allow-list / Block-list + responses: + "200": + "$ref": "#/components/responses/BlocklistIdentifier.List" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "402": + "$ref": "#/components/responses/PaymentRequired" + post: + operationId: CreateBlocklistIdentifier + summary: Add identifier to the block-list + description: Create an identifier that is blocked from accessing an instance + tags: + - Allow-list / Block-list + responses: + "200": + "$ref": "#/components/responses/BlocklistIdentifier" + "400": + "$ref": "#/components/responses/ClerkErrors" + "402": + "$ref": "#/components/responses/PaymentRequired" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/blocklist_identifiers/{identifier_id}": + delete: + operationId: DeleteBlocklistIdentifier + summary: Delete identifier from block-list + description: Delete an identifier from the instance block-list + tags: + - Allow-list / Block-list + parameters: + - name: identifier_id + in: path + description: The ID of the identifier to delete from the block-list + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "402": + "$ref": "#/components/responses/PaymentRequired" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/beta_features/instance_settings": + patch: + operationId: UpdateInstanceAuthConfig + summary: Update instance settings + description: Updates the settings of an instance + tags: + - Beta Features + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + restricted_to_allowlist: + type: boolean + description: + Whether sign up is restricted to email addresses, phone + numbers and usernames that are on the allowlist. + nullable: true + default: false + from_email_address: + type: string + description: |- + The local part of the email address from which authentication-related emails (e.g. OTP code, magic links) will be sent. + Only alphanumeric values are allowed. + Note that this value should contain only the local part of the address (e.g. `foo` for `foo@example.com`). + nullable: true + progressive_sign_up: + type: boolean + description: + Enable the Progressive Sign Up algorithm. Refer to + the [docs](https://clerk.com/docs/upgrade-guides/progressive-sign-up) + for more info. + nullable: true + session_token_template: + type: string + description: + The name of the JWT Template used to augment your session + tokens. To disable this, pass an empty string. + nullable: true + enhanced_email_deliverability: + type: boolean + description: |- + The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + This can be helpful if you do not have a high domain reputation. + nullable: true + test_mode: + type: boolean + description: |- + Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + Defaults to true for development instances. + nullable: true + responses: + "200": + "$ref": "#/components/responses/InstanceSettings" + "402": + "$ref": "#/components/responses/PaymentRequired" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/beta_features/domain": + put: + operationId: UpdateProductionInstanceDomain + summary: Update production instance domain + description: |- + Change the domain of a production instance. + + Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. + + WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + tags: + - Beta Features + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + home_url: + type: string + description: The new home URL of the production instance e.g. https://www.example.com + responses: + "202": + description: Accepted + "400": + "$ref": "#/components/responses/ClerkErrors" + "422": + "$ref": "#/components/responses/ClerkErrors" + "/actor_tokens": + post: + summary: Create actor token + description: + Create an actor token that can be used to impersonate the given + user. + operationId: CreateActorToken + tags: + - Actor Tokens + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + user_id: + type: string + description: + The ID of the user that can use the newly created sign + in token. + actor: + type: object + description: |- + The actor payload. It needs to include a sub property which should contain the ID of the actor. + This whole payload will be also included in the JWT session token. + expires_in_seconds: + type: integer + description: |- + Optional parameter to specify the life duration of the actor token in seconds. + By default, the duration is 1 hour. + default: 3600 + session_max_duration_in_seconds: + type: integer + description: |- + The maximum duration that the session which will be created by the generated actor token should last. + By default, the duration of a session created via an actor token, lasts 30 minutes. + default: 1800 + required: + - user_id + - actor + responses: + "200": + "$ref": "#/components/responses/ActorToken" + "400": + "$ref": "#/components/responses/ClerkErrors" + "402": + "$ref": "#/components/responses/PaymentRequired" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/actor_tokens/{actor_token_id}/revoke": + post: + summary: Revoke actor token + description: Revokes a pending actor token. + operationId: RevokeActorToken + tags: + - Actor Tokens + parameters: + - name: actor_token_id + in: path + description: The ID of the actor token to be revoked. + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/ActorToken" + "400": + "$ref": "#/components/responses/ClerkErrors" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/instance": + patch: + operationId: UpdateInstance + summary: Update instance settings + description: Updates the settings of an instance + tags: + - Instance Settings + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + test_mode: + type: boolean + description: |- + Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. + Defaults to true for development instances. + nullable: true + hibp: + type: boolean + description: + Whether the instance should be using the HIBP service + to check passwords for breaches + nullable: true + enhanced_email_deliverability: + type: boolean + description: |- + The "enhanced_email_deliverability" feature will send emails from "verifications@clerk.dev" instead of your domain. + This can be helpful if you do not have a high domain reputation. + nullable: true + support_email: + type: string + nullable: true + clerk_js_version: + type: string + nullable: true + development_origin: + type: string + nullable: true + experimental_allowed_origins: + type: array + items: + type: string + deprecated: true + allowed_origins: + type: array + items: + type: string + cookieless_dev: + type: boolean + description: |- + Whether the instance should operate in cookieless development mode (i.e. without third-party cookies). + Deprecated: Please use `url_based_session_syncing` instead. + deprecated: true + url_based_session_syncing: + type: boolean + description: + Whether the instance should use URL-based session syncing + in development mode (i.e. without third-party cookies). + responses: + "204": + description: Accepted + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/instance/restrictions": + patch: + operationId: UpdateInstanceRestrictions + summary: Update instance restrictions + description: Updates the restriction settings of an instance + tags: + - Instance Settings + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + allowlist: + type: boolean + nullable: true + blocklist: + type: boolean + nullable: true + responses: + "200": + "$ref": "#/components/responses/InstanceRestrictions" + "402": + "$ref": "#/components/responses/PaymentRequired" + "/instance/organization_settings": + patch: + operationId: UpdateInstanceOrganizationSettings + summary: Update instance organization settings + description: Updates the organization settings of the instance + tags: + - Instance Settings + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + enabled: + type: boolean + nullable: true + max_allowed_memberships: + type: integer + nullable: true + responses: + "200": + "$ref": "#/components/responses/OrganizationSettings" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/webhooks/svix": + post: + operationId: CreateSvixApp + summary: Create a Svix app + description: Create a Svix app and associate it with the current instance + tags: + - Webhooks + responses: + "200": + "$ref": "#/components/responses/SvixURL" + "400": + "$ref": "#/components/responses/ClerkErrors" + delete: + operationId: DeleteSvixApp + summary: Delete a Svix app + description: Delete a Svix app and disassociate it from the current instance + tags: + - Webhooks + responses: + "204": + description: Svix app was successfully deleted + "400": + "$ref": "#/components/responses/ClerkErrors" + "/webhooks/svix_url": + post: + operationId: GenerateSvixAuthURL + summary: Create a Svix Dashboard URL + description: + Generate a new url for accessing the Svix's management dashboard + for that particular instance + tags: + - Webhooks + responses: + "200": + "$ref": "#/components/responses/SvixURL" + "400": + "$ref": "#/components/responses/ClerkErrors" + "/jwt_templates": + get: + summary: List all templates + operationId: ListJWTTemplates + tags: + - JWT Templates + responses: + "200": + "$ref": "#/components/responses/JWTTemplate.List" + post: + operationId: CreateJWTTemplate + summary: Create a JWT template + description: Create a new JWT template + tags: + - JWT Templates + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: JWT template name + nullable: false + claims: + type: object + description: JWT template claims in JSON format + nullable: false + lifetime: + type: number + minimum: 30 + maximum: 315360000 + description: JWT token lifetime + nullable: true + allowed_clock_skew: + type: number + minimum: 0 + maximum: 300 + description: JWT token allowed clock skew + nullable: true + custom_signing_key: + type: boolean + description: + Whether a custom signing key/algorithm is also provided + for this template + nullable: false + signing_algorithm: + type: string + description: The custom signing algorithm to use when minting JWTs + nullable: true + signing_key: + type: string + description: + The custom signing private key to use when minting + JWTs + nullable: true + responses: + "200": + "$ref": "#/components/responses/JWTTemplate" + "400": + "$ref": "#/components/responses/ClerkErrors" + "402": + "$ref": "#/components/responses/PaymentRequired" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/jwt_templates/{template_id}": + get: + operationId: GetJWTTemplate + summary: Retrieve a template + description: Retrieve the details of a given JWT template + tags: + - JWT Templates + parameters: + - name: template_id + in: path + description: JWT Template ID + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/JWTTemplate" + "404": + "$ref": "#/components/responses/ResourceNotFound" + patch: + operationId: UpdateJWTTemplate + summary: Update a JWT template + description: Updates an existing JWT template + tags: + - JWT Templates + parameters: + - name: template_id + in: path + description: The ID of the JWT template to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: JWT template name + nullable: false + claims: + type: object + description: JWT template claims in JSON format + nullable: false + lifetime: + type: number + minimum: 30 + maximum: 315360000 + description: JWT token lifetime + nullable: true + allowed_clock_skew: + type: number + minimum: 0 + maximum: 300 + description: JWT token allowed clock skew + nullable: true + custom_signing_key: + type: boolean + description: + Whether a custom signing key/algorithm is also provided + for this template + nullable: false + signing_algorithm: + type: string + description: The custom signing algorithm to use when minting JWTs + nullable: true + signing_key: + type: string + description: + The custom signing private key to use when minting + JWTs + nullable: true + responses: + "200": + "$ref": "#/components/responses/JWTTemplate" + "400": + "$ref": "#/components/responses/ClerkErrors" + "402": + "$ref": "#/components/responses/PaymentRequired" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + delete: + operationId: DeleteJWTTemplate + summary: Delete a Template + description: "" + tags: + - JWT Templates + parameters: + - name: template_id + in: path + description: JWT Template ID + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/organizations": + get: + operationId: ListOrganizations + summary: Get a list of organizations for an instance + description: |- + This request returns the list of organizations for an instance. + Results can be paginated using the optional `limit` and `offset` query parameters. + The organizations are ordered by descending creation date. + Most recent organizations will be returned first. + tags: + - Organizations + parameters: + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + - in: query + required: false + name: include_members_count + description: + Flag to denote whether the member counts of each organization + should be included in the response or not. + schema: + type: boolean + - in: query + required: false + name: query + description: |- + Returns organizations with ID, name, or slug that match the given query. + Uses exact match for organization ID and partial match for name and slug. + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/Organizations" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + post: + operationId: CreateOrganization + summary: Create an organization + description: |- + Creates a new organization with the given name for an instance. + In order to successfully create an organization you need to provide the ID of the User who will become the organization administrator. + You can specify an optional slug for the new organization. + If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-". + Organization slugs must be unique for the instance. + You can provide additional metadata for the organization and set any custom attribute you want. + Organizations support private and public metadata. + Private metadata can only be accessed from the Backend API. + Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. + tags: + - Organizations + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the new organization + created_by: + type: string + description: + The ID of the User who will become the administrator + for the new organization + private_metadata: + type: object + description: + Metadata saved on the organization, accessible only + from the Backend API + public_metadata: + type: object + description: + Metadata saved on the organization, read-only from + the Frontend API and fully accessible (read/write) from the Backend + API + slug: + type: string + description: |- + A slug for the new organization. + Can contain only lowercase alphanumeric characters and the dash "-". + Must be unique for the instance. + max_allowed_memberships: + type: integer + description: + The maximum number of memberships allowed for this + organization + required: + - name + - created_by + responses: + "200": + "$ref": "#/components/responses/Organization" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/organizations/{organization_id}": + get: + operationId: GetOrganization + summary: Retrieve an organization by ID or slug + description: + Fetches the organization whose ID or slug matches the provided + `id_or_slug` URL query parameter. + tags: + - Organizations + parameters: + - in: path + name: organization_id + required: true + schema: + type: string + description: The ID or slug of the organization + responses: + "200": + "$ref": "#/components/responses/Organization" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + patch: + operationId: UpdateOrganization + summary: Update an organization + description: Updates an existing organization + tags: + - Organizations + parameters: + - in: path + name: organization_id + required: true + schema: + type: string + description: The ID of the organization to update + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + public_metadata: + type: object + description: + Metadata saved on the organization, that is visible + to both your frontend and backend. + private_metadata: + type: object + description: + Metadata saved on the organization that is only visible + to your backend. + name: + type: string + description: The new name of the organization + nullable: true + slug: + type: string + description: + The new slug of the organization, which needs to be + unique in the instance + nullable: true + max_allowed_memberships: + type: integer + description: + The maximum number of memberships allowed for this + organization + nullable: true + responses: + "200": + "$ref": "#/components/responses/Organization" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + delete: + operationId: DeleteOrganization + summary: Delete an organization + description: |- + Deletes the given organization. + Please note that deleting an organization will also delete all memberships and invitations. + This is not reversible. + tags: + - Organizations + parameters: + - in: path + name: organization_id + required: true + schema: + type: string + description: The ID of the organization to delete + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/organizations/{organization_id}/metadata": + patch: + operationId: MergeOrganizationMetadata + summary: Merge and update metadata for an organization + description: |- + Update organization metadata attributes by merging existing values with the provided parameters. + Metadata values will be updated via a deep merge. + Deep meaning that any nested JSON objects will be merged as well. + You can remove metadata keys at any level by setting their value to `null`. + tags: + - Organizations + parameters: + - name: organization_id + in: path + description: + The ID of the organization for which metadata will be merged + or updated + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + public_metadata: + type: object + description: |- + Metadata saved on the organization, that is visible to both your frontend and backend. + The new object will be merged with the existing value. + private_metadata: + type: object + description: |- + Metadata saved on the organization that is only visible to your backend. + The new object will be merged with the existing value. + responses: + "200": + "$ref": "#/components/responses/Organization" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/organizations/{organization_id}/logo": + put: + operationId: UploadOrganizationLogo + summary: Upload a logo for the organization + description: |- + Set or replace an organization's logo, by uploading an image file. + This endpoint uses the `multipart/form-data` request content type and accepts a file of image type. + The file size cannot exceed 10MB. + Only the following file content types are supported: `image/jpeg`, `image/png`, `image/gif`, `image/webp`, `image/x-icon`, `image/vnd.microsoft.icon`. + tags: + - Organizations + parameters: + - name: organization_id + in: path + description: The ID of the organization for which to upload a logo + required: true + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + uploader_user_id: + type: string + file: + type: string + format: binary + responses: + "200": + "$ref": "#/components/responses/OrganizationWithLogo" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "413": + "$ref": "#/components/responses/ClerkErrors" + "/organizations/{organization_id}/invitations": + post: + operationId: CreateOrganizationInvitation + summary: Create and send an organization invitation + description: |- + Creates a new organization invitation and sends an email to the provided `email_address` with a link to accept the invitation and join the organization. + You can specify the `role` for the invited organization member. + + New organization invitations get a "pending" status until they are revoked by an organization administrator or accepted by the invitee. + + The request body supports passing an optional `redirect_url` parameter. + When the invited user clicks the link to accept the invitation, they will be redirected to the URL provided. + Use this parameter to implement a custom invitation acceptance flow. + + You must specify the ID of the user that will send the invitation with the `inviter_user_id` parameter. + That user must be a member with administrator privileges in the organization. + Only "admin" members can create organization invitations. + + You can optionally provide public metadata for the organization invitation. + These metadata are visible by both the Frontend and the Backend. + When the organization invitation is accepted, the metadata will be transferred to the newly created organization membership. + tags: + - Organization Invitations + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The ID of the organization for which to send the invitation + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + email_address: + type: string + description: + The email address of the new member that is going to + be invited to the organization + inviter_user_id: + type: string + description: |- + The ID of the user that invites the new member to the organization. + Must be an administrator in the organization. + role: + type: string + description: The role of the new member in the organization + enum: + - admin + - basic_member + public_metadata: + type: object + description: + Metadata saved on the organization invitation, read-only + from the Frontend API and fully accessible (read/write) from the + Backend API. + redirect_url: + type: string + description: + Optional URL that the invitee will be redirected to + once they accept the invitation by clicking the join link in the + invitation email. + required: + - email_address + - inviter_user_id + - role + responses: + "200": + "$ref": "#/components/responses/OrganizationInvitation" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/organizations/{organization_id}/invitations/pending": + get: + operationId: ListPendingOrganizationInvitations + summary: Get a list of pending organization invitations + description: |- + This request returns the list of organization invitations with "pending" status. + These are the organization invitations that can still be used to join the organization, but have not been accepted by the invited user yet. + Results can be paginated using the optional `limit` and `offset` query parameters. + The organization invitations are ordered by descending creation date. + Most recent invitations will be returned first. + tags: + - Organization Invitations + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The organization ID. + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + responses: + "200": + "$ref": "#/components/responses/OrganizationInvitations" + "400": + "$ref": "#/components/responses/ClerkErrors" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/organizations/{organization_id}/invitations/{invitation_id}/revoke": + post: + operationId: RevokeOrganizationInvitation + summary: Revoke a pending organization invitation + description: |- + Use this request to revoke a previously issued organization invitation. + Revoking an organization invitation makes it invalid; the invited user will no longer be able to join the organization with the revoked invitation. + Only organization invitations with "pending" status can be revoked. + The request needs the `requesting_user_id` parameter to specify the user which revokes the invitation. + Only users with "admin" role can revoke invitations. + tags: + - Organization Invitations + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The organization ID. + - in: path + required: true + name: invitation_id + schema: + type: string + description: The organization invitation ID. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + requesting_user_id: + type: string + description: |- + The ID of the user that revokes the invitation. + Must be an administrator in the organization. + required: + - requesting_user_id + responses: + "200": + "$ref": "#/components/responses/OrganizationInvitation" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/organizations/{organization_id}/memberships": + post: + operationId: CreateOrganizationMembership + summary: Create a new organization membership + description: |- + Adds a user as a member to the given organization. + Only users in the same instance as the organization can be added as members. + tags: + - Organization Memberships + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The ID of the organization where the new membership will be created + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + user_id: + type: string + description: |- + The ID of the user that will be added as a member in the organization. + The user needs to exist in the same instance as the organization and must not be a member of the given organization already. + role: + type: string + description: The role that the new member will have in the organization. + enum: + - admin + - basic_member + required: + - user_id + - role + responses: + "200": + "$ref": "#/components/responses/OrganizationMembership" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + get: + operationId: ListOrganizationMemberships + summary: Get a list of all members of an organization + description: Retrieves all user memberships for the given organization + tags: + - Organization Memberships + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The organization ID. + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + responses: + "200": + "$ref": "#/components/responses/OrganizationMemberships" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/organizations/{organization_id}/memberships/{user_id}": + patch: + operationId: UpdateOrganizationMembership + summary: Update an organization membership + description: Updates the properties of an existing organization membership + tags: + - Organization Memberships + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The ID of the organization the membership belongs to + - in: path + required: true + name: user_id + schema: + type: string + description: The ID of the user that this membership belongs to + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + role: + type: string + description: The new role of the given membership. + enum: + - admin + - basic_member + required: + - role + responses: + "200": + "$ref": "#/components/responses/OrganizationMembership" + "400": + "$ref": "#/components/responses/ClerkErrors" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + delete: + operationId: DeleteOrganizationMembership + summary: Remove a member from an organization + description: Removes the given membership from the organization + tags: + - Organization Memberships + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The ID of the organization the membership belongs to + - in: path + required: true + name: user_id + schema: + type: string + description: The ID of the user that this membership belongs to + responses: + "200": + "$ref": "#/components/responses/OrganizationMembership" + "400": + "$ref": "#/components/responses/ClerkErrors" + "401": + "$ref": "#/components/responses/AuthenticationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/organizations/{organization_id}/memberships/{user_id}/metadata": + patch: + operationId: UpdateOrganizationMembershipMetadata + summary: Merge and update organization membership metadata + description: |- + Update an organization membership's metadata attributes by merging existing values with the provided parameters. + Metadata values will be updated via a deep merge. Deep means that any nested JSON objects will be merged as well. + You can remove metadata keys at any level by setting their value to `null`. + tags: + - Organization Memberships + parameters: + - in: path + required: true + name: organization_id + schema: + type: string + description: The ID of the organization the membership belongs to + - in: path + required: true + name: user_id + schema: + type: string + description: The ID of the user that this membership belongs to + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + public_metadata: + type: object + description: |- + Metadata saved on the organization membership, that is visible to both your frontend and backend. + The new object will be merged with the existing value. + private_metadata: + type: object + description: |- + Metadata saved on the organization membership that is only visible to your backend. + The new object will be merged with the existing value. + responses: + "200": + "$ref": "#/components/responses/OrganizationMembership" + "400": + "$ref": "#/components/responses/ClerkErrors" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/redirect_urls": + get: + summary: List all redirect URLs + description: Lists all whitelisted redirect_urls for the instance + operationId: ListRedirectURLs + tags: + - Redirect URLs + responses: + "200": + "$ref": "#/components/responses/RedirectURL.List" + post: + description: Create a redirect URL + operationId: CreateRedirectURL + tags: + - Redirect URLs + requestBody: + content: + application/json: + schema: + type: object + properties: + url: + type: string + description: + The full url value prefixed with `https://` or a custom + scheme e.g. `"https://my-app.com/oauth-callback"` or `"my-app://oauth-callback"` + nullable: false + responses: + "200": + "$ref": "#/components/responses/RedirectURL" + "400": + "$ref": "#/components/responses/ClerkErrors" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/redirect_urls/{id}": + get: + summary: Retrieve a redirect URL + description: Retrieve the details of the redirect URL with the given ID + operationId: GetRedirectURL + tags: + - Redirect URLs + parameters: + - name: id + in: path + description: The ID of the redirect URL + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/RedirectURL" + "404": + "$ref": "#/components/responses/ResourceNotFound" + delete: + summary: Delete a redirect URL + description: Remove the selected redirect URL from the whitelist of the instance + operationId: DeleteRedirectURL + tags: + - Redirect URLs + parameters: + - name: id + in: path + description: The ID of the redirect URL + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/sign_in_tokens": + post: + summary: Create sign-in token + description: |- + Creates a new sign-in token and associates it with the given user. + By default, sign-in tokens expire in 30 days. + You can optionally supply a different duration in seconds using the `expires_in_seconds` property. + operationId: CreateSignInToken + tags: + - Sign-in Tokens + requestBody: + content: + application/json: + schema: + type: object + properties: + user_id: + type: string + description: + The ID of the user that can use the newly created sign + in token + expires_in_seconds: + type: integer + description: |- + Optional parameter to specify the life duration of the sign in token in seconds. + By default, the duration is 30 days. + default: 2592000 + responses: + "200": + "$ref": "#/components/responses/SignInToken" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/sign_in_tokens/{sign_in_token_id}/revoke": + post: + summary: Revoke the given sign-in token + description: Revokes a pending sign-in token + operationId: RevokeSignInToken + tags: + - Sign-in Tokens + parameters: + - name: sign_in_token_id + in: path + description: The ID of the sign-in token to be revoked + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/SignInToken" + "400": + "$ref": "#/components/responses/ClerkErrors" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/sign_ups/{id}": + patch: + operationId: UpdateSignUp + summary: Update a sign-up + description: Update the sign-up with the given ID + tags: + - Sign-ups + parameters: + - name: id + in: path + description: The ID of the sign-up to update + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + custom_action: + type: boolean + description: |- + Specifies whether a custom action has run for this sign-up attempt. + This is important when your instance has been configured to require a custom action to run before converting a sign-up into a user. + After executing any external business logic you deem necessary, you can mark the sign-up as ready-to-convert by setting `custom_action` to `true`. + external_id: + type: string + description: |- + The ID of the guest attempting to sign up as used in your external systems or your previous authentication solution. + This will be copied to the resulting user when the sign-up is completed. + nullable: true + responses: + "200": + "$ref": "#/components/responses/SignUp" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "/oauth_applications": + get: + operationId: ListOAuthApplications + summary: Get a list of OAuth applications for an instance + description: |- + This request returns the list of OAuth applications for an instance. + Results can be paginated using the optional `limit` and `offset` query parameters. + The OAuth applications are ordered by descending creation date. + Most recent OAuth applications will be returned first. + tags: + - OAuth Applications + parameters: + - "$ref": "#/components/parameters/LimitParameter" + - "$ref": "#/components/parameters/OffsetParameter" + responses: + "200": + "$ref": "#/components/responses/OAuthApplications" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + post: + operationId: CreateOAuthApplication + summary: Create an OAuth application + description: |- + Creates a new OAuth application with the given name and callback URL for an instance. + The callback URL must be a valid url. + All URL schemes are allowed such as `http://`, `https://`, `myapp://`, etc... + tags: + - OAuth Applications + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the new OAuth application + callback_url: + type: string + description: The callback URL of the new OAuth application + required: + - name + - callback_url + responses: + "200": + "$ref": "#/components/responses/OAuthApplicationWithSecret" + "400": + "$ref": "#/components/responses/ClerkErrors" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + "/oauth_applications/{oauth_application_id}": + get: + operationId: GetOAuthApplication + summary: Retrieve an OAuth application by ID + description: + Fetches the OAuth application whose ID matches the provided `id` + in the path. + tags: + - OAuth Applications + parameters: + - in: path + name: oauth_application_id + required: true + schema: + type: string + description: The ID of the OAuth application + responses: + "200": + "$ref": "#/components/responses/OAuthApplication" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + patch: + operationId: UpdateOAuthApplication + summary: Update an OAuth application + description: Updates an existing OAuth application + tags: + - OAuth Applications + parameters: + - in: path + name: oauth_application_id + required: true + schema: + type: string + description: The ID of the OAuth application to update + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + name: + type: string + description: The new name of the OAuth application + callback_url: + type: string + description: The new callback URL of the OAuth application + required: + - name + - callback_url + responses: + "200": + "$ref": "#/components/responses/OAuthApplication" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "422": + "$ref": "#/components/responses/UnprocessableEntity" + delete: + operationId: DeleteOAuthApplication + summary: Delete an OAuth application + description: |- + Deletes the given OAuth application. + This is not reversible. + tags: + - OAuth Applications + parameters: + - in: path + name: oauth_application_id + required: true + schema: + type: string + description: The ID of the OAuth application to delete + responses: + "200": + "$ref": "#/components/responses/DeletedObject" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" + "/oauth_applications/{oauth_application_id}/rotate_secret": + post: + operationId: RotateOAuthApplicationSecret + summary: Rotate the client secret of the given OAuth application + description: |- + Rotates the OAuth application's client secret. + When the client secret is rotated, make sure to update it in authorized OAuth clients. + tags: + - OAuth Applications + parameters: + - name: oauth_application_id + in: path + description: + The ID of the OAuth application for which to rotate the client + secret + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/OAuthApplicationWithSecret" + "403": + "$ref": "#/components/responses/AuthorizationInvalid" + "404": + "$ref": "#/components/responses/ResourceNotFound" diff --git a/swagger/defs/user.yaml b/swagger/defs/user.yaml index e7fb142..4d26410 100644 --- a/swagger/defs/user.yaml +++ b/swagger/defs/user.yaml @@ -146,6 +146,9 @@ User: StartOfDay: description: The time day starts type: string + Status: + description: Status + type: string TaxnexusAccount: description: Taxnexus Account type: string diff --git a/swagger/external/members-vernonkeenan.yaml b/swagger/external/members-vernonkeenan.yaml index 01a3df8..e749e36 100644 --- a/swagger/external/members-vernonkeenan.yaml +++ b/swagger/external/members-vernonkeenan.yaml @@ -207,6 +207,13 @@ parameters: required: true schema: $ref: "#/definitions/UserRequest" + WebhookClerkRequest: + description: An array of new WebhookClerk records + in: body + name: webhookclerkRequest + required: true + schema: + $ref: "#/definitions/WebhookClerkRequest" activeQuery: description: Retrieve active records only? in: query @@ -219,6 +226,18 @@ parameters: name: auth0UserId required: false type: string + userIdQuery: + description: Internal User ID + in: query + name: userId + required: false + type: string + contactIdQuery: + description: Internal Contact ID (links to Account) + in: query + name: contactId + required: false + type: string databaseIdQuery: description: Record Id of a Database in: query @@ -278,56 +297,26 @@ responses: $ref: "#/definitions/Error" AttendeeResponse: description: Attendee Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/AttendeeResponse" CertificateResponse: description: Certificate Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CertificateResponse" ClusterResponse: description: Response with Cluster objects - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ClusterResponse" CourseLessonResponse: description: CourseLesson Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CourseLessonResponse" CourseResponse: description: Course Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CourseResponse" CourseSectionResponse: description: CourseSection Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CourseSectionResponse" DatabaseResponse: @@ -339,74 +328,34 @@ responses: $ref: "#/definitions/DatabaseResponse" EnrollmentResponse: description: Enrollment Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EnrollmentResponse" EventCategoryAssignmentResponse: description: EventCategoryAssignment Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EventCategoryAssignmentResponse" EventCategoryResponse: description: EventCategory Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EventCategoryResponse" EventResponse: description: Event Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EventResponse" FavoriteResponse: description: Favorite Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/FavoriteResponse" InvoiceResponse: description: Invoice Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/InvoiceResponse" IssuedCertificateResponse: description: IssuedCertificate Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/IssuedCertificateResponse" LessonProgressResponse: description: LessonProgress Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/LessonProgressResponse" NotFound: @@ -418,47 +367,22 @@ responses: $ref: "#/definitions/Error" OrderResponse: description: Order Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/OrderResponse" PaymentMethodResponse: description: PaymentMethod Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/PaymentMethodResponse" ResearchProjectCompanyResponse: description: ResearchProjectCompany Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ResearchProjectCompanyResponse" ResearchProjectResponse: description: ResearchProject Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ResearchProjectResponse" ResearchProjectTopicResponse: description: ResearchProjectTopic Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ResearchProjectTopicResponse" ServerError: @@ -477,58 +401,32 @@ responses: $ref: "#/definitions/TenantResponse" TemplateResponse: description: Response with Template objects - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/TemplateResponse" TicketResponse: description: Ticket Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/TicketResponse" TransactionResponse: description: Transaction Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/TransactionResponse" Unauthorized: description: Access Unauthorized, invalid API-KEY was used - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/Error" UnprocessableEntity: description: Unprocessable Entity, likely a bad parameter - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/Error" UserResponse: description: Response with User objects - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/UserResponse" + WebhookClerkResponse: + description: WebhookClerk Response Object + schema: + $ref: "#/definitions/WebhookClerkResponse" paths: /attendees: delete: @@ -1658,6 +1556,52 @@ paths: summary: Update an existing Transaction tags: - Transactions + /users/onboard: + post: + description: Async onboard new users + operationId: postUsersOnboard + parameters: + - $ref: "#/parameters/UserRequest" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Async onboard new users + tags: + - Users + /webhooks/clerk: + post: + description: Clerk webhook + operationId: postWebhooksClerk + parameters: + - $ref: "#/parameters/WebhookClerkRequest" + responses: + "201": + $ref: "#/responses/WebhookClerkResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Clerk webhook + tags: + - Webhooks /users: get: description: Return a list of User records from the datastore @@ -1667,6 +1611,8 @@ paths: - $ref: "#/parameters/offsetQuery" - $ref: "#/parameters/emailQuery" - $ref: "#/parameters/auth0UserIdQuery" + - $ref: "#/parameters/userIdQuery" + - $ref: "#/parameters/contactIdQuery" responses: "200": $ref: "#/responses/UserResponse" @@ -3149,6 +3095,9 @@ definitions: StartOfDay: description: The time day starts type: string + Status: + description: Onboarding Status + type: string TaxnexusAccount: description: Account type: string @@ -3239,3 +3188,208 @@ definitions: description: Username type: string type: object + WebhookClerkRequest: + description: Clerk webhook object + properties: + object: + type: string + type: + description: Clerk Name + type: string + data: + type: object + type: object + ClerkUser: + description: Clerk user object + type: object + properties: + external_id: + type: string + description: |- + The ID of the user as used in your external systems or your previous authentication solution. + Must be unique across your instance. + first_name: + type: string + description: The first name to assign to the user + last_name: + type: string + description: The last name to assign to the user + email_address: + type: array + items: + type: string + description: |- + Email addresses to add to the user. + Must be unique across your instance. + The first email address will be set as the user's primary email address. + phone_number: + type: array + items: + type: string + description: |- + Phone numbers to add to the user. + Must be unique across your instance. + The first phone number will be set as the user's primary phone number. + web3_wallet: + type: array + items: + type: string + description: |- + Web3 wallets to add to the user. + Must be unique across your instance. + The first wallet will be set as the user's primary wallet. + username: + type: string + description: |- + The username to give to the user. + It must be unique across your instance. + password: + type: string + description: |- + The plaintext password to give the user. + Must be at least 8 characters long, and can not be in any list of hacked passwords. + password_digest: + type: string + description: |- + In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + The digests should be generated with one of the supported algorithms. + The hashing algorithm can be specified using the `password_hasher` property. + password_hasher: + type: string + description: |- + The hashing algorithm that was used to generate the password digest. + The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), md5, pbkdf2_sha256, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/) and 2 [argon2](https://argon2.online/) variants, argon2i and argon2id. + Each of the above expects the incoming digest to be of a particular format. + + More specifically: + + **bcrypt:** The digest should be of the following form: + + `$$$` + + **md5:** The digest should follow the regular form e.g.: + + `5f4dcc3b5aa765d61d8327deb882cf99` + + **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + + `pbkdf2_sha256$$$` + + Note: Both the salt and the hash are expected to be base64-encoded. + + **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + + `pbkdf2_sha256$$$` + + Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + + **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + 1. uses sha1 instead of sha256 + 2. accepts the hash as a hex-encoded string + + The format is the following: + + `pbkdf2_sha1$$$` + + + **scrypt_firebase:** The Firebase-specific variant of scrypt. + The value is expected to have 6 segments separated by the $ character and include the following information: + + _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + _signer key:_ The base64 encoded signer key. + _salt separator:_ The base64 encoded salt separator. + _rounds:_ The number of rounds the algorithm needs to run. + _memory cost:_ The cost of the algorithm run + + The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + + Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + + `$$$$$` + + **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + + _version (v):_ The argon version, version 19 is assumed + _memory (m):_ The memory used by the algorithm (in kibibytes) + _iterations (t):_ The number of iterations to perform + _parallelism (p):_ The number of threads to use + + Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + The final part is the actual digest. + + `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + + **argon2id:** See the previous algorithm for an explanation of the formatting. + + For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + + `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + + If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + enum: + - bcrypt + - md5 + - pbkdf2_sha256 + - pbkdf2_sha256_django + - pbkdf2_sha1 + - scrypt_firebase + - argon2i + - argon2id + skip_password_checks: + type: boolean + description: |- + When set to `true` all password checks are skipped. + It is recommended to use this method only when migrating plaintext passwords to Clerk. + Upon migration the user base should be prompted to pick stronger password. + skip_password_requirement: + type: boolean + description: |- + When set to `true`, `password` is not required anymore when creating the user and can be omitted. + This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + totp_secret: + type: string + description: |- + In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + Please note that currently the supported options are: + * Period: 30 seconds + * Code length: 6 digits + * Algorithm: SHA1 + backup_codes: + type: array + items: + type: string + description: |- + If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + You must provide the backup codes in plain format or the corresponding bcrypt digest. + public_metadata: + type: object + description: Metadata saved on the user, that is visible to both + your Frontend and Backend APIs + private_metadata: + type: object + description: Metadata saved on the user, that is only visible to + your Backend API + unsafe_metadata: + type: object + description: |- + Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + created_at: + type: string + description: A custom date/time denoting _when_ the user signed + up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + WebhookClerkResponse: + description: Clerk webhook object + properties: + object: + type: string + type: + description: Clerk Name + type: string + data: + type: object + type: object diff --git a/swagger/external/plex-vernonkeenan.yaml b/swagger/external/plex-vernonkeenan.yaml index 2601df9..ea6bade 100644 --- a/swagger/external/plex-vernonkeenan.yaml +++ b/swagger/external/plex-vernonkeenan.yaml @@ -22,12 +22,12 @@ consumes: produces: - "application/json" parameters: - activeQuery: - description: Only retrieve active records? + slugQuery: + description: The slug of the item to retrieve in: query - name: active + name: slug required: false - type: boolean + type: string CompanyIdQuery: description: Record Id of an Company in: query @@ -102,6 +102,7 @@ paths: operationId: getCompanies parameters: - $ref: "#/parameters/CompanyIdQuery" + - $ref: "#/parameters/slugQuery" responses: "200": $ref: "#/responses/CompanyResponse" diff --git a/swagger/external/research-vernonkeenan.yaml b/swagger/external/research-vernonkeenan.yaml index 19286a1..2e725e2 100644 --- a/swagger/external/research-vernonkeenan.yaml +++ b/swagger/external/research-vernonkeenan.yaml @@ -284,8 +284,34 @@ responses: type: string schema: $ref: "#/definitions/Error" + CompanyCategoryResponse: + description: The SalesforceDevops.net CompanyCategory Object + schema: + $ref: "#/definitions/CompanyCategoryResponse" paths: + /companycategories: + get: + description: Return all or a single company category fully hydrated object + operationId: getCompanyCategories + responses: + "200": + $ref: "#/responses/CompanyCategoryResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of company categories + tags: + - CompanyCategories /companyproducts: delete: description: Delete CompanyProduct record @@ -1519,3 +1545,22 @@ definitions: Meta: $ref: "#/definitions/ResponseMeta" type: object + CompanyCategory: + properties: + CloudType: + description: The Type of Cloud Company + type: string + Count: + description: The number of companies + type: number + type: object + CompanyCategoryResponse: + description: An array of CompanyCategory objects produced in response to a request + properties: + Data: + items: + $ref: "#/definitions/CompanyCategory" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object diff --git a/swagger/external/sf-gate-vernonkeenan.yaml b/swagger/external/sf-gate-vernonkeenan.yaml index 061831f..74ea9b1 100644 --- a/swagger/external/sf-gate-vernonkeenan.yaml +++ b/swagger/external/sf-gate-vernonkeenan.yaml @@ -1380,13 +1380,13 @@ paths: tags: - Users post: - description: Create a user record in Salesforce - operationId: postUser + description: Create user recorda in Salesforce + operationId: postUsers parameters: - $ref: "#/parameters/newUserRequest" responses: "200": - $ref: "#/responses/SalesforcePostResponse" + $ref: "#/responses/UserResponse" "401": $ref: "#/responses/Unauthorized" "403": @@ -3125,25 +3125,12 @@ definitions: type: string type: object UserRequest: + description: An array of User Objects to post properties: - APIKey: - type: string - Address: - $ref: "#/definitions/Address" - Email: - type: string - Environment: - type: string - FirstName: - type: string - ID: - type: string - LastName: - type: string - TaxnexusAccount: - type: string - Title: - type: string + data: + items: + $ref: "#/definitions/User" + type: array type: object UserResponse: description: An array of Print-Ready ingest Objects diff --git a/swagger/members-vernonkeenan.yaml b/swagger/members-vernonkeenan.yaml index 0ff9e45..905df68 100644 --- a/swagger/members-vernonkeenan.yaml +++ b/swagger/members-vernonkeenan.yaml @@ -207,6 +207,13 @@ parameters: required: true schema: $ref: "#/definitions/UserRequest" + WebhookClerkRequest: + description: An array of new WebhookClerk records + in: body + name: webhookclerkRequest + required: true + schema: + $ref: "#/definitions/WebhookClerkRequest" activeQuery: description: Retrieve active records only? in: query @@ -219,6 +226,18 @@ parameters: name: auth0UserId required: false type: string + userIdQuery: + description: Internal User ID + in: query + name: userId + required: false + type: string + contactIdQuery: + description: Internal Contact ID (links to Account) + in: query + name: contactId + required: false + type: string databaseIdQuery: description: Record Id of a Database in: query @@ -278,56 +297,26 @@ responses: $ref: "#/definitions/Error" AttendeeResponse: description: Attendee Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/AttendeeResponse" CertificateResponse: description: Certificate Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CertificateResponse" ClusterResponse: description: Response with Cluster objects - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ClusterResponse" CourseLessonResponse: description: CourseLesson Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CourseLessonResponse" CourseResponse: description: Course Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CourseResponse" CourseSectionResponse: description: CourseSection Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/CourseSectionResponse" DatabaseResponse: @@ -339,74 +328,34 @@ responses: $ref: "#/definitions/DatabaseResponse" EnrollmentResponse: description: Enrollment Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EnrollmentResponse" EventCategoryAssignmentResponse: description: EventCategoryAssignment Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EventCategoryAssignmentResponse" EventCategoryResponse: description: EventCategory Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EventCategoryResponse" EventResponse: description: Event Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/EventResponse" FavoriteResponse: description: Favorite Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/FavoriteResponse" InvoiceResponse: description: Invoice Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/InvoiceResponse" IssuedCertificateResponse: description: IssuedCertificate Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/IssuedCertificateResponse" LessonProgressResponse: description: LessonProgress Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/LessonProgressResponse" NotFound: @@ -418,47 +367,22 @@ responses: $ref: "#/definitions/Error" OrderResponse: description: Order Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/OrderResponse" PaymentMethodResponse: description: PaymentMethod Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/PaymentMethodResponse" ResearchProjectCompanyResponse: description: ResearchProjectCompany Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ResearchProjectCompanyResponse" ResearchProjectResponse: description: ResearchProject Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ResearchProjectResponse" ResearchProjectTopicResponse: description: ResearchProjectTopic Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/ResearchProjectTopicResponse" ServerError: @@ -477,58 +401,32 @@ responses: $ref: "#/definitions/TenantResponse" TemplateResponse: description: Response with Template objects - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/TemplateResponse" TicketResponse: description: Ticket Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/TicketResponse" TransactionResponse: description: Transaction Response Object - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/TransactionResponse" Unauthorized: description: Access Unauthorized, invalid API-KEY was used - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/Error" UnprocessableEntity: description: Unprocessable Entity, likely a bad parameter - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/Error" UserResponse: description: Response with User objects - headers: - Access-Control-Allow-Origin: - type: string - Cache-Control: - type: string schema: $ref: "#/definitions/UserResponse" + WebhookClerkResponse: + description: WebhookClerk Response Object + schema: + $ref: "#/definitions/WebhookClerkResponse" paths: /attendees: delete: @@ -1658,6 +1556,52 @@ paths: summary: Update an existing Transaction tags: - Transactions + /users/onboard: + post: + description: Async onboard new users + operationId: postUsersOnboard + parameters: + - $ref: "#/parameters/UserRequest" + responses: + "200": + $ref: "#/responses/UserResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Async onboard new users + tags: + - Users + /webhooks/clerk: + post: + description: Clerk webhook + operationId: postWebhooksClerk + parameters: + - $ref: "#/parameters/WebhookClerkRequest" + responses: + "201": + $ref: "#/responses/WebhookClerkResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Clerk webhook + tags: + - Webhooks /users: get: description: Return a list of User records from the datastore @@ -1667,6 +1611,8 @@ paths: - $ref: "#/parameters/offsetQuery" - $ref: "#/parameters/emailQuery" - $ref: "#/parameters/auth0UserIdQuery" + - $ref: "#/parameters/userIdQuery" + - $ref: "#/parameters/contactIdQuery" responses: "200": $ref: "#/responses/UserResponse" @@ -3149,6 +3095,9 @@ definitions: StartOfDay: description: The time day starts type: string + Status: + description: Onboarding Status + type: string TaxnexusAccount: description: Account type: string @@ -3239,3 +3188,208 @@ definitions: description: Username type: string type: object + WebhookClerkRequest: + description: Clerk webhook object + properties: + object: + type: string + type: + description: Clerk Name + type: string + data: + type: object + type: object + ClerkUser: + description: Clerk user object + type: object + properties: + external_id: + type: string + description: |- + The ID of the user as used in your external systems or your previous authentication solution. + Must be unique across your instance. + first_name: + type: string + description: The first name to assign to the user + last_name: + type: string + description: The last name to assign to the user + email_address: + type: array + items: + type: string + description: |- + Email addresses to add to the user. + Must be unique across your instance. + The first email address will be set as the user's primary email address. + phone_number: + type: array + items: + type: string + description: |- + Phone numbers to add to the user. + Must be unique across your instance. + The first phone number will be set as the user's primary phone number. + web3_wallet: + type: array + items: + type: string + description: |- + Web3 wallets to add to the user. + Must be unique across your instance. + The first wallet will be set as the user's primary wallet. + username: + type: string + description: |- + The username to give to the user. + It must be unique across your instance. + password: + type: string + description: |- + The plaintext password to give the user. + Must be at least 8 characters long, and can not be in any list of hacked passwords. + password_digest: + type: string + description: |- + In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. + The digests should be generated with one of the supported algorithms. + The hashing algorithm can be specified using the `password_hasher` property. + password_hasher: + type: string + description: |- + The hashing algorithm that was used to generate the password digest. + The algorithms we support at the moment are [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), md5, pbkdf2_sha256, [pbkdf2_sha256_django](https://docs.djangoproject.com/en/4.0/topics/auth/passwords/), [scrypt_firebase](https://firebaseopensource.com/projects/firebase/scrypt/) and 2 [argon2](https://argon2.online/) variants, argon2i and argon2id. + Each of the above expects the incoming digest to be of a particular format. + + More specifically: + + **bcrypt:** The digest should be of the following form: + + `$$$` + + **md5:** The digest should follow the regular form e.g.: + + `5f4dcc3b5aa765d61d8327deb882cf99` + + **pbkdf2_sha256:** This is the PBKDF2 algorithm using the SHA256 hashing function. The format should be as follows: + + `pbkdf2_sha256$$$` + + Note: Both the salt and the hash are expected to be base64-encoded. + + **pbkdf2_sha256_django:** This is the Django-specific variant of PBKDF2 and the digest should have the following format (as exported from Django): + + `pbkdf2_sha256$$$` + + Note: The salt is expected to be un-encoded, the hash is expected base64-encoded. + + **pbkdf2_sha1:** This is similar to pkbdf2_sha256_django, but with two differences: + 1. uses sha1 instead of sha256 + 2. accepts the hash as a hex-encoded string + + The format is the following: + + `pbkdf2_sha1$$$` + + + **scrypt_firebase:** The Firebase-specific variant of scrypt. + The value is expected to have 6 segments separated by the $ character and include the following information: + + _hash:_ The actual Base64 hash. This can be retrieved when exporting the user from Firebase. + _salt:_ The salt used to generate the above hash. Again, this is given when exporting the user. + _signer key:_ The base64 encoded signer key. + _salt separator:_ The base64 encoded salt separator. + _rounds:_ The number of rounds the algorithm needs to run. + _memory cost:_ The cost of the algorithm run + + The first 2 (hash and salt) are per user and can be retrieved when exporting the user from Firebase. + The other 4 values (signer key, salt separator, rounds and memory cost) are project-wide settings and can be retrieved from the project's password hash parameters. + + Once you have all these, you can combine it in the following format and send this as the digest in order for Clerk to accept it: + + `$$$$$` + + **argon2i:** Algorithms in the argon2 family generate digests that encode the following information: + + _version (v):_ The argon version, version 19 is assumed + _memory (m):_ The memory used by the algorithm (in kibibytes) + _iterations (t):_ The number of iterations to perform + _parallelism (p):_ The number of threads to use + + Parts are demarcated by the `$` character, with the first part identifying the algorithm variant. + The middle part is a comma-separated list of the encoding options (memory, iterations, parallelism). + The final part is the actual digest. + + `$argon2i$v=19$m=4096,t=3,p=1$4t6CL3P7YiHBtwESXawI8Hm20zJj4cs7/4/G3c187e0$m7RQFczcKr5bIR0IIxbpO2P0tyrLjf3eUW3M3QSwnLc` + + **argon2id:** See the previous algorithm for an explanation of the formatting. + + For the argon2id case, the value of the algorithm in the first part of the digest is `argon2id`: + + `$argon2id$v=19$m=64,t=4,p=8$Z2liZXJyaXNo$iGXEpMBTDYQ8G/71tF0qGjxRHEmR3gpGULcE93zUJVU` + + If you need support for any particular hashing algorithm, [please let us know](https://clerk.com/support). + enum: + - bcrypt + - md5 + - pbkdf2_sha256 + - pbkdf2_sha256_django + - pbkdf2_sha1 + - scrypt_firebase + - argon2i + - argon2id + skip_password_checks: + type: boolean + description: |- + When set to `true` all password checks are skipped. + It is recommended to use this method only when migrating plaintext passwords to Clerk. + Upon migration the user base should be prompted to pick stronger password. + skip_password_requirement: + type: boolean + description: |- + When set to `true`, `password` is not required anymore when creating the user and can be omitted. + This is useful when you are trying to create a user that doesn't have a password, in an instance that is using passwords. + Please note that you cannot use this flag if password is the only way for a user to sign into your instance. + totp_secret: + type: string + description: |- + In case TOTP is configured on the instance, you can provide the secret to enable it on the newly created user without the need to reset it. + Please note that currently the supported options are: + * Period: 30 seconds + * Code length: 6 digits + * Algorithm: SHA1 + backup_codes: + type: array + items: + type: string + description: |- + If Backup Codes are configured on the instance, you can provide them to enable it on the newly created user without the need to reset them. + You must provide the backup codes in plain format or the corresponding bcrypt digest. + public_metadata: + type: object + description: Metadata saved on the user, that is visible to both + your Frontend and Backend APIs + private_metadata: + type: object + description: Metadata saved on the user, that is only visible to + your Backend API + unsafe_metadata: + type: object + description: |- + Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. + Note: Since this data can be modified from the frontend, it is not guaranteed to be safe. + created_at: + type: string + description: A custom date/time denoting _when_ the user signed + up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`). + WebhookClerkResponse: + description: Clerk webhook object + properties: + object: + type: string + type: + description: Clerk Name + type: string + data: + type: object + type: object diff --git a/swagger/plex-vernonkeenan.yaml b/swagger/plex-vernonkeenan.yaml index bd035e7..0f070e7 100644 --- a/swagger/plex-vernonkeenan.yaml +++ b/swagger/plex-vernonkeenan.yaml @@ -22,12 +22,12 @@ consumes: produces: - "application/json" parameters: - activeQuery: - description: Only retrieve active records? + slugQuery: + description: The slug of the item to retrieve in: query - name: active + name: slug required: false - type: boolean + type: string CompanyIdQuery: description: Record Id of an Company in: query @@ -102,6 +102,7 @@ paths: operationId: getCompanies parameters: - $ref: "#/parameters/CompanyIdQuery" + - $ref: "#/parameters/slugQuery" responses: "200": $ref: "#/responses/CompanyResponse" diff --git a/swagger/research-vernonkeenan.yaml b/swagger/research-vernonkeenan.yaml index 7b12b39..e4cdfa3 100644 --- a/swagger/research-vernonkeenan.yaml +++ b/swagger/research-vernonkeenan.yaml @@ -284,8 +284,34 @@ responses: type: string schema: $ref: "#/definitions/Error" + CompanyCategoryResponse: + description: The SalesforceDevops.net CompanyCategory Object + schema: + $ref: "#/definitions/CompanyCategoryResponse" paths: + /companycategories: + get: + description: Return all or a single company category fully hydrated object + operationId: getCompanyCategories + responses: + "200": + $ref: "#/responses/CompanyCategoryResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + security: + - ApiKeyAuth: [] + summary: Get a list of company categories + tags: + - CompanyCategories /companyproducts: delete: description: Delete CompanyProduct record @@ -1519,3 +1545,22 @@ definitions: Meta: $ref: "#/definitions/ResponseMeta" type: object + CompanyCategory: + properties: + CloudType: + description: The Type of Cloud Company + type: string + Count: + description: The number of companies + type: number + type: object + CompanyCategoryResponse: + description: An array of CompanyCategory objects produced in response to a request + properties: + Data: + items: + $ref: "#/definitions/CompanyCategory" + type: array + Meta: + $ref: "#/definitions/ResponseMeta" + type: object diff --git a/swagger/sf-gate-vernonkeenan.yaml b/swagger/sf-gate-vernonkeenan.yaml index dd3b4d3..5888998 100644 --- a/swagger/sf-gate-vernonkeenan.yaml +++ b/swagger/sf-gate-vernonkeenan.yaml @@ -1380,13 +1380,13 @@ paths: tags: - Users post: - description: Create a user record in Salesforce - operationId: postUser + description: Create user recorda in Salesforce + operationId: postUsers parameters: - $ref: "#/parameters/newUserRequest" responses: "200": - $ref: "#/responses/SalesforcePostResponse" + $ref: "#/responses/UserResponse" "401": $ref: "#/responses/Unauthorized" "403": @@ -3125,25 +3125,12 @@ definitions: type: string type: object UserRequest: + description: An array of User Objects to post properties: - APIKey: - type: string - Address: - $ref: "#/definitions/Address" - Email: - type: string - Environment: - type: string - FirstName: - type: string - ID: - type: string - LastName: - type: string - TaxnexusAccount: - type: string - Title: - type: string + data: + items: + $ref: "#/definitions/User" + type: array type: object UserResponse: description: An array of Print-Ready ingest Objects