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

# Issue a Meridian Accounts access token

> Mints a JWT for a Meridian user. For `client_credentials` grants, the user is identified by the `X-Meridian-User-Id` header: it must be provided for MULTI_USER integrations and omitted for SINGLE_USER integrations (the single configured user is used). For `refresh_token` grants, the user is derived from the supplied refresh token.



## OpenAPI

````yaml /products/meridian-accounts/api-reference/meridian-accounts.json post /v1/auth/token
openapi: 3.1.1
info:
  title: Meridian API
  version: '1.0'
  description: API documentation for Meridian services
  contact:
    name: Meridian
    url: https://mnai.com
    email: support@mnai.com
  license:
    name: Proprietary
    url: https://mnai.com
servers:
  - url: https://sandbox-api.va.meridianpay.com
    description: Sandbox
  - url: https://api.va.mnai.com
    description: Production
security: []
paths:
  /v1/auth/token:
    post:
      tags:
        - Auth
      summary: Issue a Meridian Accounts access token
      description: >-
        Mints a JWT for a Meridian user. For `client_credentials` grants, the
        user is identified by the `X-Meridian-User-Id` header: it must be
        provided for MULTI_USER integrations and omitted for SINGLE_USER
        integrations (the single configured user is used). For `refresh_token`
        grants, the user is derived from the supplied refresh token.
      operationId: createMeridianAccountsToken
      parameters:
        - name: X-Meridian-Program-Id
          in: header
          description: >-
            Identifies the program context for the request. Required for
            server-to-server (HMAC) authentication. See
            [Authentication](/products/meridian-accounts/guides/authentication-overview).
          required: true
          schema:
            type: string
        - name: X-Meridian-User-Id
          in: header
          description: >-
            Identifies the Meridian user targeted by the request. Required for
            server-to-server (HMAC) authentication with MULTI_USER integrations;
            omit for SINGLE_USER. See
            [Authentication](/products/meridian-accounts/guides/authentication-overview).
          schema:
            type: string
        - name: X-Meridian-Api-Key
          in: header
          description: >-
            Partner API key issued by Meridian during provisioning. Required for
            server-to-server (HMAC) authentication. See
            [Authentication](/products/meridian-accounts/guides/authentication-overview).
          required: true
          schema:
            type: string
        - name: X-Meridian-Timestamp
          in: header
          description: >-
            Current time in milliseconds since the Unix epoch. Must be within 60
            seconds of the request. Required for server-to-server (HMAC)
            authentication. See
            [Authentication](/products/meridian-accounts/guides/authentication-overview).
          required: true
          schema:
            type: string
        - name: X-Meridian-Signature
          in: header
          description: >-
            HMAC SHA-256 signature of the canonical request string, computed per
            request. Required for server-to-server (HMAC) authentication. See
            [Authentication](/products/meridian-accounts/guides/authentication-overview)
            for how to construct it.
          required: true
          schema:
            type: string
      requestBody:
        description: Either a client_credentials or refresh_token grant payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeridianTokenBody'
        required: true
      responses:
        '200':
          description: The issued access and refresh tokens
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token Response'
        '400':
          description: The request body or headers are invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeridianError'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeridianError'
        '403':
          description: API key is not entitled for the requested program
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeridianError'
        '404':
          description: Program or user was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeridianError'
        '500':
          description: Unexpected error while issuing the token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeridianError'
      security:
        - partner-api-key: []
components:
  schemas:
    MeridianTokenBody:
      type: object
      title: com.meridianpay.remittances.api.dto.meridian.MeridianTokenBody
      description: OAuth token request payload for Meridian Accounts authentication
      oneOf:
        - $ref: '#/components/schemas/Client Credentials Token Body'
        - $ref: '#/components/schemas/Refresh Token Body'
      discriminator:
        propertyName: type
        mapping:
          client_credentials: '#/components/schemas/client_credentials'
          refresh_token: '#/components/schemas/refresh_token'
    Token Response:
      type: object
      title: Token Response
      description: OAuth token response for Meridian Accounts authentication
      required:
        - access_token
        - expires_in
      properties:
        access_token:
          type: string
          description: Bearer access token
          example: access_token_abc123
        token_type:
          type: string
          description: Type of token returned
          example: Bearer
        expires_in:
          type: integer
          description: Lifetime of the access token in seconds
          example: 3600
        refresh_token:
          type:
            - string
            - 'null'
          description: Refresh token that can be exchanged for a new access token
          example: refresh_token_abc123
        scope:
          type:
            - string
            - 'null'
          description: Space-delimited scopes granted to the access token
          example: enrollment:get enrollment:activate
        issued_token_type:
          type: string
          description: URN describing the type of issued token
          example: urn:ietf:params:oauth:token-type:access_token
    MeridianError:
      type: object
      title: com.meridianpay.core.common.api.MeridianError
      description: >-
        Represents an error response from the Meridian API, including validation
        errors and an optional error code.
      required:
        - message
      properties:
        validationErrors:
          type: array
          description: >-
            An array of validation errors that occurred during the processing of
            the request. This field is optional and may be empty if there are no
            validation errors.
          items:
            $ref: '#/components/schemas/ValidationError'
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            An optional error code that provides additional information about
            the error. This field is optional and may be null.
        message:
          type: string
          description: >-
            A human-readable message describing the error. This field is
            required and should provide a clear explanation of the error that
            occurred.
    Client Credentials Token Body:
      type: object
      title: Client Credentials Token Body
      properties:
        grant_type:
          type: string
          description: OAuth grant type
          example: client_credentials
    Refresh Token Body:
      type: object
      title: Refresh Token Body
      required:
        - refresh_token
      properties:
        grant_type:
          type: string
          description: OAuth grant type
          example: refresh_token
        refresh_token:
          type: string
          description: Refresh token issued by Meridian Accounts
          example: refresh_token_abc123
    ValidationError:
      type: object
      title: com.meridianpay.core.common.api.ValidationError
      description: >-
        Represents a validation error that occurred during the processing of a
        request to the Meridian API. One of the following types of validation
        errors may be present: InvalidFormat, InvalidValue, MissingValue,
        UnprocessableValue, UnexpectedVerificationError, MissingRequestBody,
        MissingPathParameter, MissingQueryParameter, or NotFound. Each
        validation error includes a reference to the field that caused the error
        and a message describing the error.
      oneOf:
        - $ref: '#/components/schemas/InvalidFormat'
        - $ref: '#/components/schemas/InvalidValue'
        - $ref: '#/components/schemas/MissingPathParameter'
        - $ref: '#/components/schemas/MissingQueryParameter'
        - $ref: '#/components/schemas/MissingRequestBody'
        - $ref: '#/components/schemas/MissingValue'
        - $ref: '#/components/schemas/NotFound'
        - $ref: '#/components/schemas/UnexpectedVerificationError'
        - $ref: '#/components/schemas/UnprocessableValue'
      discriminator:
        propertyName: type
        mapping:
          com.meridianpay.core.common.api.ValidationError.InvalidFormat:
            $ref: '#/components/schemas/InvalidFormat'
          com.meridianpay.core.common.api.ValidationError.InvalidValue:
            $ref: '#/components/schemas/InvalidValue'
          com.meridianpay.core.common.api.ValidationError.MissingPathParameter:
            $ref: '#/components/schemas/MissingPathParameter'
          com.meridianpay.core.common.api.ValidationError.MissingQueryParameter:
            $ref: '#/components/schemas/MissingQueryParameter'
          com.meridianpay.core.common.api.ValidationError.MissingRequestBody:
            $ref: '#/components/schemas/MissingRequestBody'
          com.meridianpay.core.common.api.ValidationError.MissingValue:
            $ref: '#/components/schemas/MissingValue'
          com.meridianpay.core.common.api.ValidationError.NotFound:
            $ref: '#/components/schemas/NotFound'
          com.meridianpay.core.common.api.ValidationError.UnexpectedVerificationError:
            $ref: '#/components/schemas/UnexpectedVerificationError'
          com.meridianpay.core.common.api.ValidationError.UnprocessableValue:
            $ref: '#/components/schemas/UnprocessableValue'
    InvalidFormat:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.InvalidFormat
      description: The provided value exists, but its format is invalid for the field.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.
    InvalidValue:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.InvalidValue
      description: >-
        The provided value is syntactically valid, but not accepted for the
        field.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.
    MissingPathParameter:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.MissingPathParameter
      description: A required path parameter was not supplied.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.
    MissingQueryParameter:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.MissingQueryParameter
      description: A required query parameter was not supplied.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.
    MissingRequestBody:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.MissingRequestBody
      description: >-
        The request body is missing or does not contain the required non-null
        fields.
      properties:
        message:
          type: string
          description: A human-readable explanation of the validation failure.
        fieldRef:
          type: string
    MissingValue:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.MissingValue
      description: A required value for the field was not provided.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.
    NotFound:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.NotFound
      description: The referenced principal object was not found.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.
    UnexpectedVerificationError:
      type: object
      title: >-
        com.meridianpay.core.common.api.ValidationError.UnexpectedVerificationError
      description: A downstream verification step failed while checking the value.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.
    UnprocessableValue:
      type: object
      title: com.meridianpay.core.common.api.ValidationError.UnprocessableValue
      description: The provided value cannot be processed into a valid result.
      required:
        - fieldRef
      properties:
        fieldRef:
          type: string
          description: The field or parameter that triggered the validation error.
        message:
          type: string
          description: A human-readable explanation of the validation failure.

````