Forge Service Accounts API

Service accounts

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 6

GET /api/headless/v1/organizations/{organizationId}/service-accounts List service accounts #
POST /api/headless/v1/organizations/{organizationId}/service-accounts Create service account #
POST /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens Rotate service account token #
PATCH /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId} Update service account #
POST /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke Revoke service account token #
POST /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/disable Disable service account #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/forge:forge-service-accounts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

forge-service-accounts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Forge Service Accounts API
  version: 0.1.0
  description: Automate Forge inventory, investigations, findings, governance, fleet, policy, configuration, compliance, MCP, service-account, and audit workflows.
servers:
- url: https://api.forge.ai
  description: Forge production API
security:
- serviceAccountBearer: []
tags:
- name: Service Accounts
  description: Service accounts
paths:
  /api/headless/v1/organizations/{organizationId}/service-accounts:
    get:
      operationId: listHeadlessServiceAccounts
      tags:
      - Service Accounts
      x-forge-audience: public_headless
      x-forge-capability-id: service_accounts.read
      x-forge-required-permission: organization.manage
      x-forge-required-scopes:
      - service_accounts:read
      x-forge-risk-tier: sensitive_read
      x-forge-idempotency-required: false
      x-forge-reason-required: false
      x-forge-stability: beta
      parameters:
      - $ref: '#/components/parameters/OrganizationId'
      - name: query
        in: query
        schema:
          type: string
      - name: status
        in: query
        schema:
          type: string
          enum:
          - active
          - disabled
      - name: permissionRole
        in: query
        schema:
          type: string
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
      - name: offset
        in: query
        schema:
          type: integer
          minimum: 0
      responses:
        '200':
          description: Organization service accounts and non-secret token metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessServiceAccountListResponse'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
      summary: List service accounts
      description: List organization-scoped service accounts and non-secret token metadata.
    post:
      operationId: createHeadlessServiceAccount
      tags:
      - Service Accounts
      x-forge-audience: public_headless
      x-forge-capability-id: service_accounts.manage
      x-forge-required-permission: organization.manage
      x-forge-required-scopes:
      - service_accounts:write
      x-forge-risk-tier: admin
      x-forge-idempotency-required: true
      x-forge-reason-required: true
      x-forge-confirmation-required: true
      x-forge-stability: beta
      parameters:
      - $ref: '#/components/parameters/OrganizationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHeadlessServiceAccountRequest'
      responses:
        '201':
          description: Service account and one-time token secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessServiceAccountResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
      summary: Create service account
      description: Create, rotate, revoke, and disable organization-scoped service accounts and hashed tokens.
  /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens:
    post:
      operationId: rotateHeadlessServiceAccountToken
      tags:
      - Service Accounts
      x-forge-audience: public_headless
      x-forge-capability-id: service_accounts.manage
      x-forge-required-permission: organization.manage
      x-forge-required-scopes:
      - service_accounts:write
      x-forge-risk-tier: admin
      x-forge-idempotency-required: true
      x-forge-reason-required: true
      x-forge-confirmation-required: true
      x-forge-stability: beta
      parameters:
      - $ref: '#/components/parameters/OrganizationId'
      - $ref: '#/components/parameters/ServiceAccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RotateHeadlessServiceAccountTokenRequest'
      responses:
        '201':
          description: Newly rotated one-time token secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessServiceAccountResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
      summary: Rotate service account token
      description: Create, rotate, revoke, and disable organization-scoped service accounts and hashed tokens.
  /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}:
    patch:
      operationId: updateHeadlessServiceAccount
      tags:
      - Service Accounts
      x-forge-audience: public_headless
      x-forge-capability-id: service_accounts.manage
      x-forge-required-permission: organization.manage
      x-forge-required-scopes:
      - service_accounts:write
      x-forge-risk-tier: admin
      x-forge-idempotency-required: true
      x-forge-reason-required: true
      x-forge-confirmation-required: true
      x-forge-stability: beta
      parameters:
      - $ref: '#/components/parameters/OrganizationId'
      - $ref: '#/components/parameters/ServiceAccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateHeadlessServiceAccountRequest'
      responses:
        '200':
          description: Service account updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessServiceAccountResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
      summary: Update service account
      description: Create, rotate, revoke, and disable organization-scoped service accounts and hashed tokens.
  /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/tokens/{tokenId}/revoke:
    post:
      operationId: revokeHeadlessServiceAccountToken
      tags:
      - Service Accounts
      x-forge-audience: public_headless
      x-forge-capability-id: service_accounts.manage
      x-forge-required-permission: organization.manage
      x-forge-required-scopes:
      - service_accounts:write
      x-forge-risk-tier: admin
      x-forge-idempotency-required: true
      x-forge-reason-required: true
      x-forge-confirmation-required: true
      x-forge-stability: beta
      parameters:
      - $ref: '#/components/parameters/OrganizationId'
      - $ref: '#/components/parameters/ServiceAccountId'
      - $ref: '#/components/parameters/TokenId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeadlessAdminMutationRequest'
      responses:
        '200':
          description: Token revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
      summary: Revoke service account token
      description: Create, rotate, revoke, and disable organization-scoped service accounts and hashed tokens.
  /api/headless/v1/organizations/{organizationId}/service-accounts/{serviceAccountId}/disable:
    post:
      operationId: disableHeadlessServiceAccount
      tags:
      - Service Accounts
      x-forge-audience: public_headless
      x-forge-capability-id: service_accounts.manage
      x-forge-required-permission: organization.manage
      x-forge-required-scopes:
      - service_accounts:write
      x-forge-risk-tier: admin
      x-forge-idempotency-required: true
      x-forge-reason-required: true
      x-forge-confirmation-required: true
      x-forge-stability: beta
      parameters:
      - $ref: '#/components/parameters/OrganizationId'
      - $ref: '#/components/parameters/ServiceAccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeadlessAdminMutationRequest'
      responses:
        '200':
          description: Service account disabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessServiceAccountResponse'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
      summary: Disable service account
      description: Create, rotate, revoke, and disable organization-scoped service accounts and hashed tokens.
components:
  schemas:
    MessageResponse:
      type: object
      required:
      - message
      properties:
        message:
          type: string
    UpdateHeadlessServiceAccountRequest:
      type: object
      required:
      - name
      - permissionRole
      - scopes
      - reason
      - idempotencyKey
      properties:
        name:
          type: string
        description:
          type: string
        permissionRole:
          type: string
          enum:
          - admin
          - analyst
          - viewer
        scopes:
          type: array
          minItems: 1
          items:
            type: string
        reason:
          type: string
        idempotencyKey:
          type: string
    CreateHeadlessServiceAccountRequest:
      type: object
      required:
      - name
      - permissionRole
      - scopes
      - reason
      - idempotencyKey
      properties:
        name:
          type: string
        description:
          type: string
        permissionRole:
          type: string
          enum:
          - admin
          - analyst
          - viewer
        scopes:
          type: array
          minItems: 1
          items:
            type: string
        tokenName:
          type: string
        tokenExpiresInSeconds:
          type: integer
          minimum: 1
        reason:
          type: string
        idempotencyKey:
          type: string
    HeadlessServiceAccount:
      type: object
      required:
      - id
      - organizationId
      - name
      - description
      - permissionRole
      - scopes
      - status
      - createdAt
      - updatedAt
      properties:
        id:
          type: string
        organizationId:
          type: string
        name:
          type: string
        description:
          type: string
        ownerConsoleUserId:
          type: string
        permissionRole:
          type: string
          enum:
          - admin
          - analyst
          - viewer
        scopes:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
          - active
          - disabled
        disabledAt:
          type: string
          format: date-time
        lastUsedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        tokens:
          type: array
          items:
            $ref: '#/components/schemas/HeadlessServiceAccountToken'
    RotateHeadlessServiceAccountTokenRequest:
      type: object
      required:
      - reason
      - idempotencyKey
      properties:
        name:
          type: string
        scopes:
          type: array
          items:
            type: string
        tokenExpiresInSeconds:
          type: integer
          minimum: 1
        reason:
          type: string
        idempotencyKey:
          type: string
    HeadlessAdminMutationRequest:
      type: object
      required:
      - reason
      - idempotencyKey
      properties:
        reason:
          type: string
        idempotencyKey:
          type: string
    HeadlessServiceAccountListResponse:
      type: object
      required:
      - serviceAccounts
      properties:
        serviceAccounts:
          type: array
          items:
            $ref: '#/components/schemas/HeadlessServiceAccount'
    HeadlessServiceAccountResponse:
      type: object
      required:
      - serviceAccount
      properties:
        serviceAccount:
          $ref: '#/components/schemas/HeadlessServiceAccount'
        token:
          $ref: '#/components/schemas/HeadlessTokenSecret'
    HeadlessTokenSecret:
      type: object
      required:
      - id
      - name
      - token
      - tokenPrefix
      properties:
        id:
          type: string
        name:
          type: string
        token:
          type: string
          description: One-time secret token. Forge stores only a hash.
        tokenPrefix:
          type: string
        expiresAt:
          type: string
          format: date-time
    HeadlessServiceAccountToken:
      type: object
      required:
      - id
      - name
      - tokenPrefix
      - scopes
      - createdAt
      - updatedAt
      properties:
        id:
          type: string
        name:
          type: string
        tokenPrefix:
          type: string
        scopes:
          type: array
          items:
            type: string
        expiresAt:
          type: string
          format: date-time
        lastUsedAt:
          type: string
          format: date-time
        revokedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  parameters:
    OrganizationId:
      name: organizationId
      in: path
      required: true
      schema:
        type: string
    ServiceAccountId:
      name: serviceAccountId
      in: path
      required: true
      schema:
        type: string
    TokenId:
      name: tokenId
      in: path
      required: true
      schema:
        type: string
  responses:
    Error:
      description: Stable Forge error envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
  securitySchemes:
    serviceAccountBearer:
      type: http
      scheme: bearer
      bearerFormat: Forge service-account or delegated OAuth access token
      description: Enter a Forge service-account token or delegated OAuth access token. Mintlify adds the Bearer prefix.
x-forge-audience: public_headless
x-forge-stability: beta