{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/contraforce/json-schema/contraforce-api-response-of-service-account-created-dto-schema.json",
  "title": "ApiResponseOfServiceAccountCreatedDto",
  "description": "Standard v2 API response envelope for single-item responses.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/contraforce-service-accounts-api-openapi.yml#/components/schemas/ApiResponseOfServiceAccountCreatedDto",
  "type": "object",
  "properties": {
    "data": {
      "description": "Returned only on service account creation. Contains the plaintext client secret which is shown once.",
      "$ref": "#/$defs/ServiceAccountCreatedDto"
    },
    "meta": {
      "$ref": "#/$defs/ResponseMeta"
    }
  },
  "$defs": {
    "OrganizationalRole": {
      "enum": [
        "Admin",
        "UserAdmin",
        "WorkspaceAdmin",
        "AgentAdmin",
        "Member",
        "OrgContentOperator",
        "OrgContentAdmin"
      ]
    },
    "ResponseMeta": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": [
            "null",
            "string"
          ]
        },
        "timestamp": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "ServiceAccountCreatedDto": {
      "type": "object",
      "properties": {
        "clientId": {
          "type": "string",
          "format": "uuid"
        },
        "clientSecret": {
          "type": [
            "null",
            "string"
          ]
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "accountId": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "description": {
          "type": [
            "null",
            "string"
          ]
        },
        "isActive": {
          "type": "boolean"
        },
        "isPlatformManaged": {
          "type": "boolean",
          "description": "True for platform-provisioned service accounts (e.g. the Sentinel Content Hub ingest SA). The UI\nbadges these and hides destructive controls; the API rejects admin mutation of them."
        },
        "organizationalRole": {
          "$ref": "#/$defs/OrganizationalRole"
        },
        "clientSecretPrefix": {
          "type": [
            "null",
            "string"
          ]
        },
        "credentialExpirationDate": {
          "type": [
            "null",
            "string"
          ],
          "format": "date-time"
        },
        "workspaceAssignments": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "$ref": "#/$defs/WorkspaceRoleAssignmentDto"
          }
        },
        "credentials": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "description": "Represents a single API credential belonging to a service account.",
            "$ref": "#/$defs/ServiceAccountCredentialDto"
          }
        },
        "lastUsedAt": {
          "type": [
            "null",
            "string"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastModifiedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Returned only on service account creation. Contains the plaintext client secret which is shown once."
    },
    "ServiceAccountCredentialDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "clientSecretPrefix": {
          "type": [
            "null",
            "string"
          ]
        },
        "status": {
          "$ref": "#/$defs/ServiceAccountCredentialStatus"
        },
        "expirationDate": {
          "type": [
            "null",
            "string"
          ],
          "format": "date-time"
        },
        "lastUsedAt": {
          "type": [
            "null",
            "string"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "scopes": {
          "type": [
            "null",
            "array"
          ],
          "items": {
            "type": "string"
          },
          "description": "The API scopes granted to this credential."
        }
      },
      "description": "Represents a single API credential belonging to a service account."
    },
    "ServiceAccountCredentialStatus": {
      "enum": [
        "Active",
        "Revoked"
      ]
    },
    "WorkspaceRole": {
      "enum": [
        "Owner",
        "ContentAdmin",
        "IncidentResponder",
        "IncidentAnalyst",
        "WorkspaceReader"
      ]
    },
    "WorkspaceRoleAssignmentDto": {
      "type": "object",
      "properties": {
        "workspaceId": {
          "type": "string",
          "format": "uuid"
        },
        "workspaceName": {
          "type": [
            "null",
            "string"
          ]
        },
        "role": {
          "$ref": "#/$defs/WorkspaceRole"
        }
      }
    }
  }
}