> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sapiom.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Sapiom is for platforms whose agent shops for many users. Each user has their own Sapiom user key and saved cards.
> Use the user's key for every call made on that user's behalf. Never use one user's key for another user, and never give the agent the platform key.
> Backends call the REST API at https://api.sapiom.ai/v1. Agents can also call the hosted MCP tools at https://api.sapiom.ai/v1/mcp/pay. Both take the key in an x-api-key header.
> Keys that start with sk_test_ reach the sandbox, a separate environment with its own users and cards, at the same addresses. Use test card numbers only there.
> Never ask a user for a card number, expiry date or CVV in chat. Users enter card details only on Sapiom's hosted pages.
> Check the merchant before buying. Use purchase.type ucp_checkout only when the merchant check returns supported. Otherwise use browser_checkout.
> Follow the nextAction in each transaction result. Action links are secrets. Send each one only to the person `nextAction.actor` names.
> Use one idempotency key per transaction. Resume an unanswered create with the same request and key. If a UCP update or cancellation is uncertain, stop and hand off to a person. If a browser cancellation is uncertain, read the transaction and resend the same cancellation, with the same key, only if it is not closed. Never start a new transaction to escape an uncertain outcome.
> For a ucp_checkout purchase, report an order as placed only when order.outcome is confirmed; if it is unknown, stop and hand off to a person. A browser_checkout purchase has no order confirmation (order is null): confirm the order on the merchant's page.
> Read https://docs.sapiom.ai/skill.md for Sapiom's rules and purchase steps. To install it as a skill, run npx skills add https://docs.sapiom.ai.

# Get permissions for a new API key

> Lists the permissions that a new versioned API key can have, and which of them your key can grant. It describes [Create an API key](/api-reference/api-keys/create-an-api-key). Any API key can read this list.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/api-keys/permissions
openapi: 3.0.0
info:
  title: Sapiom Pay API
  version: '1.0'
  description: >-
    Create users, save their cards and authorize transactions. Send your
    platform key or a user key in the `x-api-key` header.
servers:
  - url: https://api.sapiom.ai
    description: Production
security:
  - api-key: []
tags:
  - name: Users
    description: One Sapiom user for each of your users. Called tenants in the API.
  - name: API keys
    description: >-
      Create, list and revoke your organization's API keys, and see which
      permissions a new key can have.
  - name: Cards
    description: Hosted setup links and the user's saved cards.
  - name: Spending limits
    description: Limits on what each card can spend.
  - name: Merchants
    description: Check whether Sapiom can buy from a merchant.
  - name: Transactions
    description: Create, read, update and cancel a transaction, and drive its UCP checkout.
  - name: Browser Pay relay
    description: The relay Browser Pay uses to send the card, for either purchase type.
paths:
  /v1/api-keys/permissions:
    get:
      tags:
        - API keys
      summary: Get permissions for a new API key
      description: >-
        Lists the permissions that a new versioned API key can have, and which
        of them your key can grant. It describes [Create an API
        key](/api-reference/api-keys/create-an-api-key). Any API key can read
        this list.
      operationId: ApiKeyPermissionsController_general
      parameters:
        - description: >-
            `tenant:` and a user's ID. A versioned platform key uses it to act
            for that user.
          in: header
          name: Sapiom-Scope
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyPermissionCatalogResponseDto'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyErrorResponseDto'
          description: The key is missing or not valid.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyErrorResponseDto'
          description: Your key cannot read this list for the target in `Sapiom-Scope`.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyErrorResponseDto'
          description: >-
            The user in `Sapiom-Scope` is unavailable. No active user in your
            organization has this ID.
      security:
        - api-key: []
components:
  schemas:
    ApiKeyPermissionCatalogResponseDto:
      properties:
        accessTypes:
          items:
            $ref: '#/components/schemas/ApiKeyAccessTypeChoiceDto'
          type: array
        authorizationVersion:
          enum:
            - 1
          type: number
        issuanceEnabled:
          description: >-
            Whether Sapiom accepts versioned key creation. When it is `false`,
            you can still read this list.
          type: boolean
        issuanceRestrictions:
          description: >-
            Why your key cannot create a versioned key through the matching
            create endpoint.
          items:
            enum:
              - issuance_disabled
              - unsupported_issuer_source
              - missing_creation_permission
              - email_unverified
            type: string
          type: array
        keyType:
          enum:
            - live
            - test
          type: string
          description: '`live` or `test`. Your key''s environment decides it.'
        permissions:
          items:
            $ref: '#/components/schemas/ApiKeyPermissionDefinitionDto'
          type: array
        tenantDefaults:
          $ref: '#/components/schemas/ApiKeyTenantDefaultsDto'
        tenantId:
          description: >-
            The organization or user that the matching create endpoint creates
            keys for.
          format: uuid
          type: string
      required:
        - authorizationVersion
        - tenantId
        - keyType
        - issuanceEnabled
        - issuanceRestrictions
        - accessTypes
        - tenantDefaults
        - permissions
      type: object
    ApiKeyErrorResponseDto:
      properties:
        apiKeyId:
          description: >-
            Only on `409 api_key_already_created`: the ID of the key that the
            first request created. Sapiom does not return its `plainKey` again.
          format: uuid
          type: string
        code:
          description: Stable public code. Most policy refusals use forbidden.
          type: string
        error:
          description: Existing HTTP error description, when supplied.
          type: string
        message:
          oneOf:
            - type: string
            - items:
                type: string
              type: array
        path:
          type: string
        requestId:
          type: string
        statusCode:
          type: number
        timestamp:
          format: date-time
          type: string
      required:
        - statusCode
        - code
        - message
        - requestId
        - timestamp
        - path
      type: object
    ApiKeyAccessTypeChoiceDto:
      properties:
        accessType:
          enum:
            - tenant
            - platform
          type: string
        available:
          description: Sapiom offers this access type on the matching create endpoint.
          type: boolean
        grantable:
          description: >-
            Your key can create a key with this access type. For `tenant`, this
            can be true only for a custom selection.
          type: boolean
      required:
        - accessType
        - available
        - grantable
      type: object
    ApiKeyPermissionDefinitionDto:
      properties:
        action:
          type: string
        available:
          description: >-
            A user key can have this permission, and versioned key creation is
            enabled.
          type: boolean
        description:
          type: string
        displayName:
          type: string
        grantable:
          description: >-
            Your key can grant this permission and the permissions that it
            includes.
          type: boolean
        group:
          enum:
            - purchasing
            - policy
            - card-management
            - platform
          type: string
        includes:
          description: >-
            Other permissions that this permission includes. Sapiom stores them
            with it.
          items:
            type: string
          type: array
        introducedIn:
          enum:
            - 0
            - 1
          type: number
        permissionKey:
          type: string
        resource:
          type: string
        tenantEligible:
          type: boolean
        tenantSelection:
          enum:
            - default
            - optional
            - included
            - ineligible
          type: string
          description: >-
            `default`: one of the fixed-key defaults. `optional`: a user key
            gets it only when you select it. `included`: other permissions
            include it. `ineligible`: platform keys only.
      required:
        - permissionKey
        - resource
        - action
        - displayName
        - description
        - group
        - tenantSelection
        - tenantEligible
        - introducedIn
        - includes
        - available
        - grantable
      type: object
    ApiKeyTenantDefaultsDto:
      properties:
        grantable:
          description: >-
            Your key can grant all the fixed-key defaults, and versioned key
            creation is enabled.
          type: boolean
        permissions:
          description: >-
            The fixed-key defaults: the permissions that a `fixed` user key gets
            when the request omits `permissions`.
          items:
            type: string
          type: array
      required:
        - permissions
        - grantable
      type: object
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your platform key for user management, or a user key for everything
        else.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.