Equinix Authentication API

Nearly all of the endpoints in the API require authentication. Authentication is performed by providing an authentication token (interchangeably referred to as an API key) in the `X-Auth-Token` HTTP request header. User API keys can be obtained by creating them in the Equinix Metal Portal or by using the [Create a User API Key](#operation/createAPIKey) endpoint. Project API keys can also be obtained by creating them in the Equinix Metal Portal or by using the [Create a Project API Key](#operation/createProjectAPIKey) endpoint. Project API keys are scoped to a single project and can only be used to access resources within that project. For example, to use an authenticated API token, you would make a request like the following: ```bash curl -H 'X-Auth-Token: my_authentication_token' \ https://api.equinix.com/metal/v1/user/api-keys ``` Applications can take advantage of the Equinix Metal API and API keys to perform any of the actions that can be performed in the Equinix Metal Portal. For example, you can use the API to create and manage devices, projects, and other resources. API keys can be deleted without affecting any of the resources created with them. Access to applications using the API can be revoked by deleting the API key used to authenticate the application.

OpenAPI Specification

equinix-authentication-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Equinix API Authentication API
  description: 'Equinix APIs use the OAuth 2.0 for authentication and authorization. Equinix supports the resource owner password and the client credentials flow.

    To begin, obtain OAuth 2.0 client credentials from the Equinix Developer Console under "My Apps". Then your client application  requests an access token from the Equinix API Authorization endpoint, extracts the access_token from the response, and sends the Bearer token to the API that you want to access'
  termsOfService: https://www.equinix.com/about/legal/terms
  contact:
    name: Equinix API Support
    url: https://docs.equinix.com/api-support.htm
  version: '1.2'
servers:
- url: https://api.equinix.com
tags:
- description: "Nearly all of the endpoints in the API require authentication. Authentication is performed by providing an authentication token (interchangeably referred to as an API key) in the `X-Auth-Token` HTTP request header.\n\n<!-- ReDoc-Inject: <security-definitions> -->\n\nUser API keys can be obtained by creating them in the Equinix Metal Portal or by using the [Create a User API Key](#operation/createAPIKey) endpoint.\n\nProject API keys can also be obtained by creating them in the Equinix Metal Portal or by using the [Create a Project API Key](#operation/createProjectAPIKey) endpoint. Project API keys are scoped to a single project and can only be used to access resources within that project.\n\nFor example, to use an authenticated API token, you would make a request like the following:\n\n```bash\ncurl -H 'X-Auth-Token: my_authentication_token' \\\n  https://api.equinix.com/metal/v1/user/api-keys\n```\n\nApplications can take advantage of the Equinix Metal API and API keys to perform any of the actions that can be performed in the Equinix Metal Portal. For example, you can use the API to create and manage devices, projects, and other resources.\n\nAPI keys can be deleted without affecting any of the resources created with them. Access to applications using the API can be revoked by deleting the API key used to authenticate the application.\n"
  externalDocs:
    url: https://metal.equinix.com/developers/docs/accounts/users/#api-keys
  name: Authentication
paths:
  /api-keys/{id}:
    delete:
      description: Deletes the API key.
      operationId: deleteAPIKey
      parameters:
      - description: API Key UUID
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '204':
          description: no content
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: not found
      summary: Delete the API key
      tags:
      - Authentication
  /projects/{id}/api-keys:
    get:
      description: Returns all API keys for a specific project.
      operationId: findProjectAPIKeys
      parameters:
      - description: Project UUID
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      - description: 'Nested attributes to include. Included objects will return their full

          attributes. Attribute names can be dotted (up to 3 levels) to included deeply

          nested objects.'
        explode: false
        in: query
        name: include
        schema:
          items:
            type: string
          type: array
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthTokenList'
          description: ok
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: not found
      summary: Retrieve all API keys for the project.
      tags:
      - Authentication
    post:
      description: Creates an API key for a project.
      operationId: createProjectAPIKey
      parameters:
      - description: Project UUID
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      - description: 'Nested attributes to include. Included objects will return their full

          attributes. Attribute names can be dotted (up to 3 levels) to included deeply

          nested objects.'
        explode: false
        in: query
        name: include
        schema:
          items:
            type: string
          type: array
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthTokenInput'
        description: API Key to create
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthToken'
          description: created
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unprocessable entity
      summary: Create an API key for a project.
      tags:
      - Authentication
  /user/api-keys:
    get:
      description: Returns all API keys for the current user.
      operationId: findAPIKeys
      parameters:
      - description: Search by description
        in: query
        name: search
        schema:
          type: string
      - description: 'Nested attributes to include. Included objects will return their full

          attributes. Attribute names can be dotted (up to 3 levels) to included deeply

          nested objects.'
        explode: false
        in: query
        name: include
        schema:
          items:
            type: string
          type: array
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthTokenList'
          description: ok
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: not found
      summary: Retrieve all user API keys
      tags:
      - Authentication
    post:
      description: Creates a API key for the current user.
      operationId: createAPIKey
      parameters:
      - description: 'Nested attributes to include. Included objects will return their full

          attributes. Attribute names can be dotted (up to 3 levels) to included deeply

          nested objects.'
        explode: false
        in: query
        name: include
        schema:
          items:
            type: string
          type: array
        style: form
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthTokenInput'
        description: API key to create
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthToken'
          description: created
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unprocessable entity
      summary: Create an API key
      tags:
      - Authentication
  /user/api-keys/{id}:
    delete:
      description: Deletes the current user API key.
      operationId: deleteUserAPIKey
      parameters:
      - description: API Key UUID
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '204':
          description: no content
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: not found
      summary: Delete the API key
      tags:
      - Authentication
components:
  schemas:
    Href:
      example:
        href: href
      properties:
        href:
          type: string
      required:
      - href
      type: object
    User:
      example:
        avatar_thumb_url: avatar_thumb_url
        last_login_at: 2000-01-23 04:56:07+00:00
        max_projects: 2
        timezone: timezone
        default_project_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
        created_at: 2000-01-23 04:56:07+00:00
        last_name: last_name
        short_id: short_id
        fraud_score: fraud_score
        emails:
        - href: href
        - href: href
        default_organization_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
        full_name: full_name
        avatar_url: avatar_url
        updated_at: 2000-01-23 04:56:07+00:00
        phone_number: phone_number
        customdata: '{}'
        href: href
        id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
        first_name: first_name
        max_organizations: 3
        two_factor_auth: two_factor_auth
        email: email
      properties:
        avatar_thumb_url:
          type: string
        avatar_url:
          type: string
        created_at:
          format: date-time
          type: string
        customdata:
          type: object
        default_organization_id:
          format: uuid
          type: string
        default_project_id:
          format: uuid
          type: string
        email:
          type: string
        emails:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        first_name:
          type: string
        fraud_score:
          type: string
        full_name:
          type: string
        href:
          type: string
        id:
          format: uuid
          type: string
        last_login_at:
          format: date-time
          type: string
        last_name:
          type: string
        max_organizations:
          type: integer
        max_projects:
          type: integer
        phone_number:
          type: string
        short_id:
          type: string
        timezone:
          type: string
        two_factor_auth:
          type: string
        updated_at:
          format: date-time
          type: string
      type: object
    AuthTokenInput:
      example:
        read_only: true
        description: description
      properties:
        description:
          type: string
        read_only:
          type: boolean
      type: object
    Error:
      description: Error responses are included with 4xx and 5xx HTTP responses from the API service. Either "error" or "errors" will be set.
      properties:
        error:
          description: A description of the error that caused the request to fail.
          type: string
        errors:
          description: A list of errors that contributed to the request failing.
          items:
            description: An error message that contributed to the request failing.
            type: string
          type: array
      type: object
    Organization:
      example:
        website: website
        address:
          country: country
          address: address
          address2: address2
          city: city
          coordinates:
            latitude: latitude
            longitude: longitude
          state: state
          zip_code: zip_code
        projects:
        - href: href
        - href: href
        credit_amount: 1.4658129
        created_at: 2000-01-23 04:56:07+00:00
        description: description
        billing_address:
          country: country
          address: address
          address2: address2
          city: city
          coordinates:
            latitude: latitude
            longitude: longitude
          state: state
          zip_code: zip_code
        memberships:
        - href: href
        - href: href
        enforce_2fa_at: 2000-01-23 04:56:07+00:00
        twitter: twitter
        updated_at: 2000-01-23 04:56:07+00:00
        terms: 5
        members:
        - href: href
        - href: href
        name: name
        logo: logo
        customdata: '{}'
        id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
      properties:
        address:
          $ref: '#/components/schemas/Address'
        billing_address:
          $ref: '#/components/schemas/Address'
        created_at:
          format: date-time
          type: string
        credit_amount:
          format: float
          type: number
        customdata:
          type: object
        description:
          type: string
        enforce_2fa_at:
          description: Force to all members to have enabled the two factor authentication after that date, unless the value is null
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        logo:
          type: string
        members:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        memberships:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        name:
          type: string
        projects:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        terms:
          type: integer
        twitter:
          type: string
        updated_at:
          format: date-time
          type: string
        website:
          type: string
      type: object
    AuthToken_user:
      allOf:
      - $ref: '#/components/schemas/User'
      - description: Available only for user tokens
        type: object
    AuthTokenList:
      example:
        api_keys:
        - updated_at: 2000-01-23 04:56:07+00:00
          read_only: true
          created_at: 2000-01-23 04:56:07+00:00
          description: description
          project: null
          id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
          user: null
          token: token
        - updated_at: 2000-01-23 04:56:07+00:00
          read_only: true
          created_at: 2000-01-23 04:56:07+00:00
          description: description
          project: null
          id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
          user: null
          token: token
      properties:
        api_keys:
          items:
            $ref: '#/components/schemas/AuthToken'
          type: array
      type: object
    Project_type:
      description: The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers.
      enum:
      - default
      - vmce
      type: string
    Project:
      example:
        devices:
        - href: href
        - href: href
        volumes:
        - href: href
        - href: href
        created_at: 2000-01-23 04:56:07+00:00
        type: null
        memberships:
        - href: href
        - href: href
        bgp_config:
          href: href
        tags:
        - tags
        - tags
        max_devices: '{}'
        ssh_keys:
        - href: href
        - href: href
        updated_at: 2000-01-23 04:56:07+00:00
        invitations:
        - href: href
        - href: href
        members:
        - href: href
        - href: href
        organization:
          website: website
          address:
            country: country
            address: address
            address2: address2
            city: city
            coordinates:
              latitude: latitude
              longitude: longitude
            state: state
            zip_code: zip_code
          projects:
          - href: href
          - href: href
          credit_amount: 1.4658129
          created_at: 2000-01-23 04:56:07+00:00
          description: description
          billing_address:
            country: country
            address: address
            address2: address2
            city: city
            coordinates:
              latitude: latitude
              longitude: longitude
            state: state
            zip_code: zip_code
          memberships:
          - href: href
          - href: href
          enforce_2fa_at: 2000-01-23 04:56:07+00:00
          twitter: twitter
          updated_at: 2000-01-23 04:56:07+00:00
          terms: 5
          members:
          - href: href
          - href: href
          name: name
          logo: logo
          customdata: '{}'
          id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
        name: name
        network_status: '{}'
        customdata: '{}'
        href: href
        id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
        payment_method:
          href: href
      properties:
        bgp_config:
          $ref: '#/components/schemas/Href'
        created_at:
          format: date-time
          type: string
        customdata:
          type: object
        devices:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        href:
          type: string
        id:
          format: uuid
          type: string
        invitations:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        max_devices:
          type: object
        members:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        memberships:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        name:
          description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis.
          maxLength: 80
          minLength: 1
          type: string
        network_status:
          type: object
        organization:
          $ref: '#/components/schemas/Organization'
        payment_method:
          $ref: '#/components/schemas/Href'
        ssh_keys:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        updated_at:
          format: date-time
          type: string
        volumes:
          items:
            $ref: '#/components/schemas/Href'
          type: array
        type:
          $ref: '#/components/schemas/Project_type'
        tags:
          items:
            type: string
          type: array
      type: object
    Address:
      example:
        country: country
        address: address
        address2: address2
        city: city
        coordinates:
          latitude: latitude
          longitude: longitude
        state: state
        zip_code: zip_code
      properties:
        address:
          type: string
        address2:
          type: string
        city:
          type: string
        coordinates:
          $ref: '#/components/schemas/Coordinates'
        country:
          type: string
        state:
          type: string
        zip_code:
          type: string
      required:
      - address
      - country
      - zip_code
      type: object
    Coordinates:
      example:
        latitude: latitude
        longitude: longitude
      properties:
        latitude:
          type: string
        longitude:
          type: string
      type: object
    AuthToken:
      example:
        updated_at: 2000-01-23 04:56:07+00:00
        read_only: true
        created_at: 2000-01-23 04:56:07+00:00
        description: description
        project: null
        id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
        user: null
        token: token
      properties:
        created_at:
          format: date-time
          type: string
        description:
          description: Available only for API keys
          type: string
        id:
          format: uuid
          type: string
        project:
          $ref: '#/components/schemas/AuthToken_project'
        read_only:
          type: boolean
        token:
          type: string
        updated_at:
          format: date-time
          type: string
        user:
          $ref: '#/components/schemas/AuthToken_user'
      type: object
    AuthToken_project:
      allOf:
      - $ref: '#/components/schemas/Project'
      - description: Available only for project tokens
        type: object
x-eqx-api-linter-skip-rules:
- 3
- 38