Affinity Auth API

Operations about auths

Operations 1

GET /v2/auth/whoami Get current user #

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/affinity-auth-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

affinity-auth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: ''
  x-affinity-api-version: '2024-01-01'
  contact:
    email: support@affinity.co
    name: Affinity Support
    url: https://support.affinity.co
  description: '# Introduction


    Welcome to Affinity API v2!'
  license:
    name: Proprietary
    url: https://www.affinity.co/legal/terms-of-use
  termsOfService: https://www.affinity.co/legal/terms-of-use
  title: Affinity API v2 Auth API
  x-logo:
    url: https://s3.us-west-2.amazonaws.com/assets.affinity.co/img/logos/full-color-svg.svg
    altText: Affinity logo
servers:
- url: https://api.affinity.co
security:
- bearerAuth: []
tags:
- description: Operations about auths
  name: Auth
paths:
  /v2/auth/whoami:
    get:
      description: 'Returns information about the authenticated user, their current organization, and API key permissions.

        Use this endpoint to verify your authentication and understand your available API access levels.'
      summary: Get current user
      operationId: v2_auth_whoami__GET
      tags:
      - Auth
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoAmI'
          headers:
            X-Ratelimit-Limit-User:
              $ref: '#/components/headers/X-Ratelimit-Limit-User'
            X-Ratelimit-Limit-User-Remaining:
              $ref: '#/components/headers/X-Ratelimit-Limit-User-Remaining'
            X-Ratelimit-Limit-User-Reset:
              $ref: '#/components/headers/X-Ratelimit-Limit-User-Reset'
            X-Ratelimit-Limit-Org:
              $ref: '#/components/headers/X-Ratelimit-Limit-Org'
            X-Ratelimit-Limit-Org-Remaining:
              $ref: '#/components/headers/X-Ratelimit-Limit-Org-Remaining'
            X-Ratelimit-Limit-Org-Reset:
              $ref: '#/components/headers/X-Ratelimit-Limit-Org-Reset'
        '404':
          $ref: '#/components/responses/404'
        default:
          $ref: '#/components/responses/default'
components:
  headers:
    X-Ratelimit-Limit-Org-Remaining:
      description: Number of requests remaining for the account
      schema:
        type: integer
    X-Ratelimit-Limit-User-Reset:
      description: Time in seconds before the limit resets for the user
      schema:
        type: integer
    X-Ratelimit-Limit-Org:
      description: Number of requests allowed per month for the account
      schema:
        type: integer
    X-Ratelimit-Limit-User:
      description: Number of requests allowed per minute for the user
      schema:
        type: integer
    X-Ratelimit-Limit-User-Remaining:
      description: Number of requests remaining for the user
      schema:
        type: integer
    X-Ratelimit-Limit-Org-Reset:
      description: Time in seconds before the limit resets for the account
      schema:
        type: integer
  schemas:
    AuthenticationError:
      title: AuthenticationError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - authentication
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: authentication
        message: 🚨 Error! Sound the alarm! 🚨
    NotFoundErrors:
      title: NotFoundErrors
      description: NotFoundErrors model
      type: object
      properties:
        errors:
          description: NotFoundError errors
          type: array
          items:
            $ref: '#/components/schemas/NotFoundError'
      required:
      - errors
      additionalProperties: false
      examples:
      - errors:
        - code: not-found
          message: 🚨 Error! Sound the alarm! 🚨
        - code: not-found
          message: 🚨 Error! Sound the alarm! 🚨
    WhoAmI:
      title: WhoAmI
      description: WhoAmI model
      type: object
      properties:
        tenant:
          $ref: '#/components/schemas/Tenant'
        user:
          $ref: '#/components/schemas/User'
        grant:
          $ref: '#/components/schemas/Grant'
      required:
      - grant
      - tenant
      - user
      additionalProperties: false
      examples:
      - grant:
          createdAt: '2023-01-01T00:00:00Z'
          scopes:
          - api
          type: api-key
        user:
          firstName: John
          lastName: Smith
          emailAddress: john.smith@contoso.com
          id: 1
        tenant:
          name: Contoso Ltd.
          subdomain: contoso
          id: 1
    AuthorizationError:
      title: AuthorizationError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - authorization
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: authorization
        message: 🚨 Error! Sound the alarm! 🚨
    UnsupportedMediaTypeError:
      title: UnsupportedMediaTypeError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - unsupported-media-type
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: unsupported-media-type
        message: 🚨 Error! Sound the alarm! 🚨
    ValidationError:
      title: ValidationError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - validation
        message:
          description: Error message
          type: string
        param:
          description: Param the error refers to
          type: string
      required:
      - code
      - message
      - param
      additionalProperties: false
      examples:
      - code: validation
        param: limit
        message: 🚨 Error! Sound the alarm! 🚨
    UnprocessableEntityError:
      title: UnprocessableEntityError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - unprocessable-entity
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: unprocessable-entity
        message: 🚨 Error! Sound the alarm! 🚨
    ServerError:
      title: ServerError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - server
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: server
        message: 🚨 Error! Sound the alarm! 🚨
    RateLimitError:
      title: RateLimitError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - rate-limit
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: rate-limit
        message: 🚨 Error! Sound the alarm! 🚨
    User:
      title: User
      type: object
      properties:
        id:
          description: The user's unique identifier
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          examples:
          - 1
        firstName:
          description: The user's first name
          type: string
          examples:
          - John
        lastName:
          description: The user's last name
          type:
          - string
          - 'null'
          examples:
          - Smith
        emailAddress:
          description: The user's email address
          type: string
          format: email
          examples:
          - john.smith@contoso.com
      required:
      - emailAddress
      - firstName
      - id
      - lastName
      additionalProperties: false
      examples:
      - firstName: John
        lastName: Smith
        emailAddress: john.smith@contoso.com
        id: 1
    NotImplementedError:
      title: NotImplementedError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - not-implemented
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: not-implemented
        message: 🚨 Error! Sound the alarm! 🚨
    NotAcceptableError:
      title: NotAcceptableError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - not-acceptable
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: not-acceptable
        message: 🚨 Error! Sound the alarm! 🚨
    Errors:
      title: Errors
      type: object
      properties:
        errors:
          description: Errors
          type: array
          items:
            $ref: '#/components/schemas/Error'
      required:
      - errors
      additionalProperties: false
    NotFoundError:
      title: NotFoundError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - not-found
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: not-found
        message: 🚨 Error! Sound the alarm! 🚨
    MethodNotAllowedError:
      title: MethodNotAllowedError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - method-not-allowed
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: method-not-allowed
        message: 🚨 Error! Sound the alarm! 🚨
    ConflictError:
      title: ConflictError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - conflict
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: conflict
        message: 🚨 Error! Sound the alarm! 🚨
    Error:
      title: Error
      oneOf:
      - $ref: '#/components/schemas/AuthenticationError'
      - $ref: '#/components/schemas/AuthorizationError'
      - $ref: '#/components/schemas/BadRequestError'
      - $ref: '#/components/schemas/ConflictError'
      - $ref: '#/components/schemas/MethodNotAllowedError'
      - $ref: '#/components/schemas/NotAcceptableError'
      - $ref: '#/components/schemas/NotFoundError'
      - $ref: '#/components/schemas/NotImplementedError'
      - $ref: '#/components/schemas/RateLimitError'
      - $ref: '#/components/schemas/ServerError'
      - $ref: '#/components/schemas/UnprocessableEntityError'
      - $ref: '#/components/schemas/UnsupportedMediaTypeError'
      - $ref: '#/components/schemas/ValidationError'
      discriminator:
        propertyName: code
        mapping:
          authentication: '#/components/schemas/AuthenticationError'
          authorization: '#/components/schemas/AuthorizationError'
          bad-request: '#/components/schemas/BadRequestError'
          conflict: '#/components/schemas/ConflictError'
          method-not-allowed: '#/components/schemas/MethodNotAllowedError'
          not-acceptable: '#/components/schemas/NotAcceptableError'
          not-found: '#/components/schemas/NotFoundError'
          not-implemented: '#/components/schemas/NotImplementedError'
          rate-limit: '#/components/schemas/RateLimitError'
          server: '#/components/schemas/ServerError'
          unprocessable-entity: '#/components/schemas/UnprocessableEntityError'
          unsupported-media-type: '#/components/schemas/UnsupportedMediaTypeError'
          validation: '#/components/schemas/ValidationError'
    BadRequestError:
      title: BadRequestError
      type: object
      properties:
        code:
          description: Error code
          type: string
          enum:
          - bad-request
        message:
          description: Error message
          type: string
      required:
      - code
      - message
      additionalProperties: false
      examples:
      - code: bad-request
        message: 🚨 Error! Sound the alarm! 🚨
    Grant:
      title: Grant
      type: object
      properties:
        type:
          description: The type of grant used to authenticate
          type: string
          enum:
          - api-key
          - access-token
          examples:
          - api-key
        scopes:
          description: The scopes available to the current grant
          type: array
          items:
            type: string
          examples:
          - - api
        createdAt:
          description: When the grant was created
          type: string
          format: date-time
          examples:
          - '2023-01-01T00:00:00Z'
      required:
      - createdAt
      - scopes
      - type
      additionalProperties: false
      examples:
      - createdAt: '2023-01-01T00:00:00Z'
        scopes:
        - api
        type: api-key
    Tenant:
      title: Tenant
      type: object
      properties:
        id:
          description: The tenant's unique identifier
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          examples:
          - 1
        name:
          description: The name of the tenant
          type: string
          examples:
          - Contoso Ltd.
        subdomain:
          description: The tenant's subdomain under affinity.co
          type: string
          format: hostname
          examples:
          - contoso
      required:
      - id
      - name
      - subdomain
      additionalProperties: false
      examples:
      - name: Contoso Ltd.
        subdomain: contoso
        id: 1
  responses:
    '404':
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundErrors'
      headers:
        X-Ratelimit-Limit-User:
          $ref: '#/components/headers/X-Ratelimit-Limit-User'
        X-Ratelimit-Limit-User-Remaining:
          $ref: '#/components/headers/X-Ratelimit-Limit-User-Remaining'
        X-Ratelimit-Limit-User-Reset:
          $ref: '#/components/headers/X-Ratelimit-Limit-User-Reset'
        X-Ratelimit-Limit-Org:
          $ref: '#/components/headers/X-Ratelimit-Limit-Org'
        X-Ratelimit-Limit-Org-Remaining:
          $ref: '#/components/headers/X-Ratelimit-Limit-Org-Remaining'
        X-Ratelimit-Limit-Org-Reset:
          $ref: '#/components/headers/X-Ratelimit-Limit-Org-Reset'
    default:
      description: Errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
      headers:
        X-Ratelimit-Limit-User:
          $ref: '#/components/headers/X-Ratelimit-Limit-User'
        X-Ratelimit-Limit-User-Remaining:
          $ref: '#/components/headers/X-Ratelimit-Limit-User-Remaining'
        X-Ratelimit-Limit-User-Reset:
          $ref: '#/components/headers/X-Ratelimit-Limit-User-Reset'
        X-Ratelimit-Limit-Org:
          $ref: '#/components/headers/X-Ratelimit-Limit-Org'
        X-Ratelimit-Limit-Org-Remaining:
          $ref: '#/components/headers/X-Ratelimit-Limit-Org-Remaining'
        X-Ratelimit-Limit-Org-Reset:
          $ref: '#/components/headers/X-Ratelimit-Limit-Org-Reset'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer