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

# Authenticate

Acquiring an access token is a three-step process:

1. Redirect the user to Ebury to authorise your app
2. The user authenticates with Ebury
3. If 2FA is enabled, the user provides the verification code on the 2FA screen
4. Ebury redirects the user back to your app with an authorization code
5. Exchange the authorization code for an access token


## OpenAPI

````yaml /openapi/ebury-spec.json post /authenticate
openapi: 3.0.0
info:
  description: |
    Ebury API allows customers:
      to retrieve accounts, balances, beneficiaries, and transactions;
      to get buy/sell estimates and quotes, book trades and retrieve trade history;
      to allocate payments to a trade and beneficiary, and to submit payments in bulk;
      to download documents such as trade receipt, payment instruction and payment receipt;
      to manage the authorised persons on their account.
    The Metadata API allows applications to clarify some parts of the Ebury API
      that are impractical to express schematically.
  termsOfService: https://docs.ebury.io/#terms-of-use
  title: Ebury API
  version: '0.1'
servers:
  - url: https://{environment}.ebury.io
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox
security:
  - api_key: []
paths:
  /authenticate:
    post:
      tags:
        - OAuth2.0
      summary: Authenticate
      description: Retrieve the login template
      requestBody:
        description: The OAuth 2.0 state parameter.
        content:
          '*/*': {}
        required: true
      responses:
        '200':
          description: HTML login template
          content:
            application/json:
              schema:
                type: string
            text/html:
              schema:
                type: string
        '400':
          description: >-
            Formatting or schema validation error or invalid data.See error
            message for further details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
            text/html:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '429':
          description: Too many requests
          content: {}
        '495':
          description: Certificate Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
            text/html:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    ErrorMessage:
      description: An error message.
      properties:
        code:
          type: string
          description: The code for the error.
        details:
          description: Error details
          type: string
        message:
          type: string
          description: A short description of the cause of the error.
      required:
        - code
        - message
        - details
      type: object
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````