{"openapi":"3.1.0","info":{"contact":{"email":"hi@hedia.com","name":"Hedia ApS","url":"https://hedia.com"},"termsOfService":"https://www.hedia.com/terms-and-conditions","title":"OAuth 2.0 API","version":"1.0.0"},"servers":[{"url":"https://oauth2.hedia.com/api/v1"}],"security":[{"serviceWithUser":[]}],"tags":[{"name":"Authorizations","description":"Manage authorizations.","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations#authorizations","description":"Documentation"}},{"name":"Clients","description":"Manage clients.","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations#clients","description":"Documentation"}},{"name":"Client Secrets","description":"Manage client secrets.","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations#client-secrets","description":"Documentation"}}],"paths":{"/apps/{appId}/clients":{"parameters":[{"$ref":"#/components/parameters/AppIdPathParameter"}],"get":{"operationId":"listAppClients","summary":"List clients for an app","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientArray"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Clients"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/listAppClients","description":"Documentation"}},"post":{"operationId":"createAppClient","summary":"Create a client for an app","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientRequestBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Clients"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/createAppClient","description":"Documentation"}}},"/apps/{appId}/clients/{clientId}":{"parameters":[{"$ref":"#/components/parameters/AppIdPathParameter"},{"$ref":"#/components/parameters/ClientIdPathParameter"}],"delete":{"operationId":"deleteAppClient","summary":"Remove a client from an app","responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Clients"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/deleteAppClient","description":"Documentation"}},"get":{"operationId":"getAppClient","summary":"Get a client for an app","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Clients"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/getAppClient","description":"Documentation"}},"patch":{"operationId":"updateAppClient","summary":"Update a client for an app","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateClientRequestBody"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Clients"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/updateAppClient","description":"Documentation"}}},"/apps/{appId}/clients/{clientId}/authorizations":{"parameters":[{"$ref":"#/components/parameters/AppIdPathParameter"},{"$ref":"#/components/parameters/ClientIdPathParameter"}],"get":{"operationId":"listAppClientAuthorizations","summary":"List authorizations for an app client","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationArray"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Clients"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/listAppClientAuthorizations","description":"Documentation"}}},"/apps/{appId}/clients/{clientId}/secrets":{"parameters":[{"$ref":"#/components/parameters/AppIdPathParameter"},{"$ref":"#/components/parameters/ClientIdPathParameter"}],"get":{"operationId":"listAppClientSecrets","summary":"List secrets for an app client","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientSecretArray"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Client Secrets"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/listAppClientSecrets","description":"Documentation"}},"post":{"operationId":"createAppClientSecret","summary":"Create a secret for an app client","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientSecret"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Client Secrets"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/createAppClientSecret","description":"Documentation"}}},"/apps/{appId}/clients/{clientId}/secrets/{clientSecretId}":{"parameters":[{"$ref":"#/components/parameters/AppIdPathParameter"},{"$ref":"#/components/parameters/ClientIdPathParameter"},{"$ref":"#/components/parameters/ClientSecretIdPathParameter"}],"delete":{"operationId":"deleteAppClientSecret","summary":"Remove a secret from an app client","responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Client Secrets"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/deleteAppClientSecret","description":"Documentation"}}},"/users/{userId}/authorizations":{"parameters":[{"$ref":"#/components/parameters/UserIdPathParameter"}],"get":{"operationId":"listUserAuthorizations","summary":"List authorizations for a user","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationArray"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Authorizations"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/listUserAuthorizations","description":"Documentation"}}},"/users/{userId}/authorizations/{authorizationId}":{"parameters":[{"$ref":"#/components/parameters/UserIdPathParameter"},{"$ref":"#/components/parameters/AuthorizationIdPathParameter"}],"delete":{"operationId":"deleteUserAuthorization","summary":"Remove an authorization from a user","responses":{"204":{"$ref":"#/components/responses/NoContent"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"default":{"$ref":"#/components/responses/InternalServerError"}},"tags":["Authorizations"],"externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/operations/deleteUserAuthorization","description":"Documentation"}}}},"components":{"securitySchemes":{"serviceWithUser":{"description":"A Service Bearer JSON Web Token with a sub property set to a user ID.","type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AppId":{"title":"App ID","description":"The app ID is a unique identifier for an application.","type":"string","format":"uuid","example":"9352258f-0263-47d1-b9c7-16cd93be7501","$id":"./components/schemas/AppId","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/AppId","description":"Documentation"}},"ProblemDetails":{"title":"Problem Details","description":"A problem details object provides additional information about a problem that occurred during an API request.","type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type.","examples":["/problems/unauthorized","about:blank"]},"title":{"type":"string","description":"A short, human-readable summary of the problem type.","examples":["Unauthorized"]},"status":{"type":"number","description":"The HTTP status code generated by the origin server for this occurrence of the problem.","examples":[401]},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem.","examples":["You must authenticate and provide the necessary permissions to access this resource. Please check your credentials or token."]}},"required":["type"],"$id":"./components/schemas/ProblemDetails","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ProblemDetails","description":"Documentation"}},"ClientId":{"title":"Client ID","description":"The client ID is a unique identifier for a client.","type":"string","format":"uuid","example":"9352258f-0263-47d1-b9c7-16cd93be7501","$id":"./components/schemas/ClientId","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientId","description":"Documentation"}},"ClientName":{"title":"Client Name","description":"The client name is used to identify the client in the user interface.","type":"string","minLength":1,"maxLength":255,"$id":"./components/schemas/ClientName","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientName","description":"Documentation"}},"ClientRedirectUrls":{"title":"Client Redirect Urls","description":"The redirect URLs are a comma-separated list of URLs that the client is allowed to redirect to.","type":"array","items":{"type":"string","format":"uri"},"$id":"./components/schemas/ClientRedirectUrls","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientRedirectUrls","description":"Documentation"}},"ClientApplicationType":{"title":"Client Application Type","description":"The kind of application the client is, as defined by [OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata):\n\n- `web` — a web application. The default.\n- `native` — an app installed on a device, such as an iOS or Android app.\n","type":"string","enum":["web","native"],"$id":"./components/schemas/ClientApplicationType","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientApplicationType","description":"Documentation"}},"CreatedAt":{"title":"Created At","type":"string","format":"date-time","$id":"./components/schemas/CreatedAt","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/CreatedAt","description":"Documentation"}},"CreatedBy":{"title":"Created By","type":"string","format":"uuid","$id":"./components/schemas/CreatedBy","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/CreatedBy","description":"Documentation"}},"UpdatedAt":{"title":"Updated At","type":"string","format":"date-time","$id":"./components/schemas/UpdatedAt","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/UpdatedAt","description":"Documentation"}},"UpdatedBy":{"title":"Updated By","type":"string","format":"uuid","$id":"./components/schemas/UpdatedBy","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/UpdatedBy","description":"Documentation"}},"Client":{"title":"Client","type":"object","properties":{"id":{"$ref":"#/components/schemas/ClientId"},"appId":{"$ref":"#/components/schemas/AppId"},"name":{"$ref":"#/components/schemas/ClientName"},"redirectUrls":{"$ref":"#/components/schemas/ClientRedirectUrls"},"applicationType":{"$ref":"#/components/schemas/ClientApplicationType"},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"createdBy":{"$ref":"#/components/schemas/CreatedBy"},"updatedAt":{"$ref":"#/components/schemas/UpdatedAt"},"updatedBy":{"$ref":"#/components/schemas/UpdatedBy"}},"required":["id","appId","name","redirectUrls","applicationType","createdAt"],"additionalProperties":false,"$id":"./components/schemas/Client","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/Client","description":"Documentation"}},"ClientArray":{"title":"Client Array","type":"array","items":{"$ref":"#/components/schemas/Client"},"$id":"./components/schemas/ClientArray","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientArray","description":"Documentation"}},"CreateClientRequestBody":{"title":"Create Client Request Body","type":"object","properties":{"name":{"$ref":"#/components/schemas/ClientName"},"redirectUrls":{"$ref":"#/components/schemas/ClientRedirectUrls"},"applicationType":{"$ref":"#/components/schemas/ClientApplicationType"}},"required":["name","redirectUrls"],"additionalProperties":false,"$id":"./components/schemas/CreateClientRequestBody","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/CreateClientRequestBody","description":"Documentation"}},"UpdateClientRequestBody":{"title":"Update Client Request Body","type":"object","properties":{"name":{"$ref":"#/components/schemas/ClientName"},"redirectUrls":{"$ref":"#/components/schemas/ClientRedirectUrls"},"applicationType":{"$ref":"#/components/schemas/ClientApplicationType"}},"additionalProperties":false,"$id":"./components/schemas/UpdateClientRequestBody","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/UpdateClientRequestBody","description":"Documentation"}},"AuthorizationId":{"title":"Authorization ID","description":"The authorization ID is a unique identifier for an authorization.","type":"string","format":"uuid","example":"9352258f-0263-47d1-b9c7-16cd93be7501","$id":"./components/schemas/AuthorizationId","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/AuthorizationId","description":"Documentation"}},"AuthenticationMethod":{"title":"Authentication Method","description":"A type of credential defined by ID Service that the user authenticated with.","type":"string","$id":"./components/schemas/AuthenticationMethod","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/AuthenticationMethod","description":"Documentation"}},"AuthenticationMethods":{"title":"Authentication Methods","description":"The types of credentials that the user authenticated with, as reported by ID Service when the authorization was last authenticated. The array is ordered by the time each type of credential was last used, latest method last.","type":"array","items":{"$ref":"#/components/schemas/AuthenticationMethod"},"uniqueItems":true,"$id":"./components/schemas/AuthenticationMethods","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/AuthenticationMethods","description":"Documentation"}},"AuthenticationTime":{"title":"Authentication Time","description":"Time when the End-User authentication occurred.","type":"string","format":"date-time","example":"2023-01-01T12:00:00Z","$id":"./components/schemas/AuthenticationTime","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/AuthenticationTime","description":"Documentation"}},"UserId":{"title":"User ID","description":"The user ID is a unique identifier for a user.","type":"string","format":"uuid","example":"9352258f-0263-47d1-b9c7-16cd93be7501","$id":"./components/schemas/UserId","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/UserId","description":"Documentation"}},"Scope":{"title":"Scope","description":"A scope associated with an authorization. Has the format \"<action>:<scope>\".","type":"string","examples":["read:name","read:bloodGlucose","write:bloodGlucose"],"$id":"./components/schemas/Scope","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/Scope","description":"Documentation"}},"ScopeArray":{"title":"List of scopes","description":"List of scopes","type":"array","items":{"$ref":"#/components/schemas/Scope"},"$id":"./components/schemas/ScopeArray","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ScopeArray","description":"Documentation"}},"Authorization":{"title":"Authorization","type":"object","properties":{"id":{"$ref":"#/components/schemas/AuthorizationId"},"authenticationMethods":{"$ref":"#/components/schemas/AuthenticationMethods"},"authenticationTime":{"$ref":"#/components/schemas/AuthenticationTime"},"clientId":{"$ref":"#/components/schemas/ClientId"},"userId":{"$ref":"#/components/schemas/UserId"},"scope":{"$ref":"#/components/schemas/ScopeArray"},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"createdBy":{"$ref":"#/components/schemas/CreatedBy"},"updatedAt":{"$ref":"#/components/schemas/UpdatedAt"},"updatedBy":{"$ref":"#/components/schemas/UpdatedBy"}},"required":["id","authenticationMethods","authenticationTime","clientId","userId","scope","createdAt"],"additionalProperties":false,"$id":"./components/schemas/Authorization","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/Authorization","description":"Documentation"}},"AuthorizationArray":{"title":"Authorization Array","type":"array","items":{"$ref":"#/components/schemas/Authorization"},"$id":"./components/schemas/AuthorizationArray","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/AuthorizationArray","description":"Documentation"}},"ClientSecretId":{"title":"Client Secret ID","description":"The client secret ID is a unique identifier for a client secret.","type":"string","format":"uuid","example":"9352258f-0263-47d1-b9c7-16cd93be7501","$id":"./components/schemas/ClientSecretId","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientSecretId","description":"Documentation"}},"ClientSecretSecret":{"title":"Client Secret Secret","description":"A client secret is a secret known only to the application and the authorization server. It is essentially the application's own password.","type":"string","minLength":32,"maxLength":32,"$id":"./components/schemas/ClientSecretSecret","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientSecretSecret","description":"Documentation"}},"ClientSecret":{"title":"Client Secret","type":"object","properties":{"id":{"$ref":"#/components/schemas/ClientSecretId"},"clientId":{"$ref":"#/components/schemas/ClientId"},"secret":{"$ref":"#/components/schemas/ClientSecretSecret"},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"createdBy":{"$ref":"#/components/schemas/CreatedBy"}},"required":["id","clientId","secret","createdAt"],"additionalProperties":false,"$id":"./components/schemas/ClientSecret","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientSecret","description":"Documentation"}},"ClientSecretArray":{"title":"Client Secret Array","type":"array","items":{"$ref":"#/components/schemas/ClientSecret"},"$id":"./components/schemas/ClientSecretArray","externalDocs":{"url":"https://developer.hedia.com/services/oauth2/api/v1/components/schemas/ClientSecretArray","description":"Documentation"}}},"parameters":{"AppIdPathParameter":{"name":"appId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AppId"}},"ClientIdPathParameter":{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ClientId"}},"ClientSecretIdPathParameter":{"name":"clientSecretId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ClientSecretId"}},"UserIdPathParameter":{"name":"userId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/UserId"}},"AuthorizationIdPathParameter":{"name":"authorizationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AuthorizationId"}}},"responses":{"InternalServerError":{"description":"Internal Server Error","content":{"application/json":{},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"BadRequest":{"description":"Bad Request","content":{"application/json":{},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{},"application/problem+json":{}}},"NotFound":{"description":"Not Found","content":{"application/json":{},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"NoContent":{"description":"No Content"}}},"externalDocs":{"url":"https://developer.hedia.com/","description":"Documentation"}}