{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/snyk/main/json-schema/snyk-service-account-schema.json", "title": "ServiceAccount", "x-generated": "2026-10-04", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/snyk-service-accounts-api-openapi.yml#/components/schemas/ServiceAccount", "additionalProperties": false, "properties": { "attributes": { "additionalProperties": false, "properties": { "access_token": { "description": "The Snyk access token for this service account. Only returned on creation, and only when auth_type is access_token..", "type": "string" }, "access_token_expires_at": { "description": "The expiry date of the access token. Only provided when auth_type is access_token.", "format": "date-time", "type": "string" }, "access_token_ttl_seconds": { "description": "The time, in seconds, that an oauth access token will be valid for. Defaults to 1hr if unset. Only provided when auth_type is oauth_client_secret or oauth_private_key_jwt.", "type": "number" }, "api_key": { "description": "The Snyk API Key for this service account. Only returned on creation, and only when auth_type is api_key.", "type": "string" }, "auth_type": { "description": "The authentication strategy for the service account:\n * api_key - Regular Snyk API Key.\n * oauth_client_secret - OAuth2 client_credentials grant, which returns a client secret that can be used to retrieve an oauth access token.\n * oauth_private_key_jwt - OAuth2 client_credentials grant, using private_key_jwt client_assertion as laid out in OIDC Connect Core 1.0, section 9.\n * access_token - Access tokens are long-lived, can be used more than once for increased flexibility, and have expiries for enhanced security.", "enum": [ "api_key", "oauth_client_secret", "oauth_private_key_jwt", "access_token" ], "type": "string" }, "client_id": { "description": "The service account's attached client-id. Used to request an access-token. Only provided when auth_type is oauth_client_secret or oauth_private_key_jwt.", "type": "string" }, "client_secret": { "description": "The client secret used for obtaining oauth access tokens. Only sent on creation of new service accounts and cannot be retrieved thereafter. Only provided when auth_type is oauth_client_secret.", "type": "string" }, "created_at": { "description": "The time at which the service account was created.", "format": "date-time", "type": "string" }, "jwks_url": { "description": "A JWKs URL used to verify signed JWT requests against. Must be https. Only provided when auth_type is oauth_private_key_jwt.", "type": "string" }, "level": { "description": "The level of access for the service account:\n * Group - the service account was created at the Group level.\n * Org - the service account was created at the Org level.", "enum": [ "Group", "Org" ], "type": "string" }, "name": { "description": "A human-friendly name of the service account.", "type": "string" }, "role_id": { "description": "The ID of the role which the Service Account is associated with.", "format": "uuid", "type": "string" } }, "required": [ "name", "auth_type", "role_id" ], "type": "object" }, "id": { "format": "uuid", "type": "string" }, "links": { "$ref": "#/$defs/Links" }, "type": { "type": "string" } }, "required": [ "type", "id", "attributes" ], "type": "object", "$defs": { "LinkProperty": { "oneOf": [ { "description": "A string containing the link’s URL.", "type": "string" }, { "additionalProperties": false, "properties": { "href": { "description": "A string containing the link’s URL.", "type": "string" }, "meta": { "additionalProperties": true, "description": "Free-form object that may contain non-standard information.", "type": "object" } }, "required": [ "href" ], "type": "object" } ] }, "Links": { "additionalProperties": false, "properties": { "first": { "$ref": "#/$defs/LinkProperty" }, "last": { "$ref": "#/$defs/LinkProperty" }, "next": { "$ref": "#/$defs/LinkProperty" }, "prev": { "$ref": "#/$defs/LinkProperty" }, "related": { "$ref": "#/$defs/LinkProperty" }, "self": { "$ref": "#/$defs/LinkProperty" } }, "type": "object" } } }