Applications
OIDC and SAML application management, OAuth 2.0 token operations, and dynamic client registration.
/api/v1/organizations/:orgId/applicationsCreate ApplicationBearer Token▾Create a new OIDC or SAML application within an organization. Returns the newly created application record including the generated clientId and clientSecret.
Parameters
Request Body
Response Fields
Response Example
{
"id": "app_01hxyz",
"name": "My Web App",
"description": "Customer-facing web application.",
"type": "OIDC",
"clientId": "cid_abc123",
"clientSecret": "cs_secret_value",
"redirectUris": [
"https://app.example.com/callback"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"responseTypes": [
"code"
],
"scopes": [
"openid",
"profile",
"email"
],
"tokenEndpointAuthMethod": "client_secret_post",
"isPublicClient": false,
"requireDpop": false,
"dpopNonceEnabled": false,
"isAiAgent": false,
"organizationId": "org_01hxyz",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}Code Examples
/api/v1/organizations/:orgId/applicationsList ApplicationsBearer Token▾Retrieve all applications belonging to an organization.
Parameters
Response Fields
Response Example
{
"data": [
{
"id": "app_01hxyz",
"name": "My Web App",
"type": "OIDC",
"clientId": "cid_abc123",
"organizationId": "org_01hxyz",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
},
{
"id": "app_02abcd",
"name": "Enterprise SAML App",
"type": "SAML",
"clientId": "cid_def456",
"organizationId": "org_01hxyz",
"createdAt": "2025-01-20T09:00:00Z",
"updatedAt": "2025-01-20T09:00:00Z"
}
]
}Code Examples
/api/v1/organizations/:orgId/applications/:appIdGet ApplicationBearer Token▾Retrieve a single application by its ID.
Parameters
Response Fields
Response Example
{
"id": "app_01hxyz",
"name": "My Web App",
"description": "Customer-facing web application.",
"type": "OIDC",
"clientId": "cid_abc123",
"redirectUris": [
"https://app.example.com/callback"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"responseTypes": [
"code"
],
"scopes": [
"openid",
"profile",
"email"
],
"tokenEndpointAuthMethod": "client_secret_post",
"isPublicClient": false,
"requireDpop": false,
"dpopNonceEnabled": false,
"isAiAgent": false,
"organizationId": "org_01hxyz",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}Code Examples
/api/v1/organizations/:orgId/applications/:appIdUpdate ApplicationBearer Token▾Update an existing application. All body fields mirror CreateApplicationDto and are optional (partial update).
Parameters
Request Body
Response Fields
Response Example
{
"id": "app_01hxyz",
"name": "My Updated App",
"description": "Updated description.",
"type": "OIDC",
"clientId": "cid_abc123",
"redirectUris": [
"https://app.example.com/callback",
"https://app.example.com/silent-renew"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"responseTypes": [
"code"
],
"scopes": [
"openid",
"profile",
"email",
"phone"
],
"tokenEndpointAuthMethod": "client_secret_post",
"isPublicClient": false,
"organizationId": "org_01hxyz",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-02-01T12:00:00Z"
}Code Examples
/api/v1/organizations/:orgId/applications/:appId/rotate-secretRotate Client SecretBearer Token▾Generate a new client secret for an application, invalidating the previous one. Store the returned secret immediately — it will not be shown again.
Parameters
Response Fields
Response Example
{
"clientSecret": "cs_new_secret_value"
}Code Examples
/api/v1/organizations/:orgId/applications/:appIdDelete ApplicationBearer Token▾Permanently delete an application and all associated OAuth tokens and configurations.
Parameters
Response Fields
Response Example
{
"deleted": true,
"id": "app_01hxyz"
}Code Examples
/api/v1/organizations/:orgId/applications/:appId/usersAssign Users to ApplicationBearer Token▾Replace the full set of users assigned to an application. The provided list of userIds becomes the authoritative assignment.
Parameters
Request Body
Response Fields
Response Example
{
"applicationId": "app_01hxyz",
"userIds": [
"user_abc",
"user_def"
]
}Code Examples
/api/v1/organizations/:orgId/applications/:appId/groupsAssign Groups to ApplicationBearer Token▾Replace the full set of groups assigned to an application. The provided list of groupIds becomes the authoritative assignment.
Parameters
Request Body
Response Fields
Response Example
{
"applicationId": "app_01hxyz",
"groupIds": [
"grp_xyz",
"grp_abc"
]
}Code Examples
/api/v1/oauth/tokenToken ExchangeBasic Auth▾Exchange an authorization code or refresh token for access tokens. Supports the authorization_code and refresh_token grant types. Client credentials can be sent either via HTTP Basic authentication or in the request body.
Parameters
Request Body
Response Fields
Response Example
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyX2FiYyJ9.signature",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "openid profile email",
"refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA"
}Code Examples
/api/v1/oauth/introspectIntrospect Token▾Determine whether a token is active and retrieve its metadata, as defined in RFC 7662.
Request Body
Response Fields
Response Example
{
"active": true,
"scope": "openid profile email",
"client_id": "cid_abc123",
"exp": 1736944200,
"sub": "user_abc",
"iat": 1736940600
}Code Examples
/api/v1/oauth/revokeRevoke Token▾Immediately revoke an access token or refresh token, as defined in RFC 7009. Revoked tokens are rejected by the introspection endpoint.
Request Body
Response Fields
Response Example
{
"status": "revoked"
}Code Examples
/api/v1/oauth/registerDynamic Client Registration▾Register a new OAuth 2.0 client dynamically, as per RFC 7591. Requires an x-api-token header for authorization. Returns client credentials and a registration access token for subsequent management.
Parameters
Request Body
Response Fields
Response Example
{
"client_id": "cid_dynamic_abc",
"client_secret": "cs_dynamic_secret",
"registration_access_token": "rat_xyz789",
"registration_client_uri": "https://api.sutraid.com/api/v1/oauth/register/cid_dynamic_abc"
}Code Examples
/api/v1/.well-known/openid-configuration/:orgIdOIDC Discovery▾Retrieve the OpenID Connect discovery document for an organization. Clients use this endpoint to auto-configure OIDC parameters such as the issuer, authorization endpoint, token endpoint, and supported algorithms.
Parameters
Response Fields
Response Example
{
"issuer": "https://api.sutraid.com/org_01hxyz",
"authorization_endpoint": "https://api.sutraid.com/api/v1/oauth/authorize",
"token_endpoint": "https://api.sutraid.com/api/v1/oauth/token",
"userinfo_endpoint": "https://api.sutraid.com/api/v1/oauth/userinfo",
"jwks_uri": "https://api.sutraid.com/api/v1/.well-known/jwks.json",
"registration_endpoint": "https://api.sutraid.com/api/v1/oauth/register",
"scopes_supported": [
"openid",
"profile",
"email",
"phone",
"address"
],
"response_types_supported": [
"code"
],
"grant_types_supported": [
"authorization_code",
"refresh_token"
],
"subject_types_supported": [
"public"
],
"id_token_signing_alg_values_supported": [
"RS256"
],
"token_endpoint_auth_methods_supported": [
"client_secret_basic",
"client_secret_post",
"private_key_jwt"
],
"claims_supported": [
"sub",
"iss",
"aud",
"exp",
"iat",
"email",
"name",
"given_name",
"family_name"
]
}Code Examples
/api/v1/saml/:orgId/:appId/metadata.xmlGet SAML IdP Metadata▾Retrieve the SAML Identity Provider metadata XML for a specific application. Provide this to your Service Provider to configure the SAML trust relationship.
Parameters
Response Fields
Response Example
{
"contentType": "application/xml",
"body": "<?xml version=\"1.0\"?><EntityDescriptor entityID=\"https://api.sutraid.com/saml/org_01hxyz/app_saml_01\">...</EntityDescriptor>"
}Code Examples
/api/v1/saml/:orgId/:appId/ssoSAML SSO Endpoint▾SAML Single Sign-On endpoint. Receives a SAMLRequest from the Service Provider, validates it, authenticates the user, and returns an HTML page with an auto-submitting form containing the signed SAMLResponse destined for the SP Assertion Consumer Service URL.
Parameters
Request Body
Response Fields
Response Example
{
"contentType": "text/html",
"body": "<html><body><form method=\"POST\" action=\"https://app.example.com/saml/acs\"><input type=\"hidden\" name=\"SAMLResponse\" value=\"PHNhbWxwOlJlc3BvbnNlLi4uPg==\" /><input type=\"hidden\" name=\"RelayState\" value=\"https://app.example.com/dashboard\" /><noscript><button type=\"submit\">Continue</button></noscript></form><script>document.forms[0].submit();</script></body></html>"
}