Slash Oauth2 API

The Oauth2 API from Slash — 2 operation(s) for oauth2.

OpenAPI Specification

slash-oauth2-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Slash Public Account Oauth2 API
  description: API description
  version: 0.0.1
  contact: {}
servers:
- url: https://api.slash.com
  description: production
security:
- api_key: []
- partner_api_key: []
- bearer: []
- developer_application: []
tags:
- name: Oauth2
paths:
  /oauth2/token:
    x-reference-path: paths/oauth2/token/route.yaml
    post:
      description: Get or refresh an access token
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              oneOf:
              - type: object
                properties:
                  grant_type:
                    type: string
                    enum:
                    - authorization_code
                  code:
                    type: string
                  code_verifier:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                  prompt:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                  scope:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                  redirect_uri:
                    type: string
                required:
                - grant_type
                - code
                - redirect_uri
              - type: object
                properties:
                  grant_type:
                    type: string
                    enum:
                    - refresh_token
                  refresh_token:
                    type: string
                  scope:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                  code:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                  code_verifier:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                  prompt:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                  redirect_uri:
                    description: Unused by Slash, but required in the OAuth spec.
                    type: string
                required:
                - grant_type
                - refresh_token
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  expires_in:
                    type: integer
                  id_token:
                    type: string
                  refresh_token:
                    type: string
                required:
                - access_token
                - expires_in
                - id_token
                - refresh_token
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - developer_application: []
      tags:
      - Oauth2
  /oauth2/userinfo:
    x-reference-path: paths/oauth2/userinfo/route.yaml
    get:
      description: Get userinfo
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paths.oauth2.userinfo._dto.UserInfoResponse'
                x-entrypoint:
                  virtualPath: paths/oauth2/userinfo/_dto/UserInfoResponse
                  sourcePath: paths/oauth2/userinfo/_dto/UserInfoResponse.yaml
                  title: UserInfoResponse
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - bearer: []
      tags:
      - Oauth2
    post:
      description: Get userinfo
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paths.oauth2.userinfo._dto.UserInfoResponse'
                x-entrypoint:
                  virtualPath: paths/oauth2/userinfo/_dto/UserInfoResponse
                  sourcePath: paths/oauth2/userinfo/_dto/UserInfoResponse.yaml
                  title: UserInfoResponse
                  origin: ./src/publicApi
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - bearer: []
      tags:
      - Oauth2
components:
  schemas:
    paths.oauth2.userinfo._dto.UserInfoResponse:
      type: object
      properties:
        sub:
          type: string
          description: The user's ID
        name:
          type: string
          description: The user's full name
        email:
          type: string
        phone_number:
          type: string
      required:
      - sub
      - name
      - email
      x-entrypoint:
        virtualPath: paths/oauth2/userinfo/_dto/UserInfoResponse
        sourcePath: paths/oauth2/userinfo/_dto/UserInfoResponse.yaml
        title: UserInfoResponse
        origin: ./src/publicApi
      title: UserInfoResponse
    Error:
      type: object
      properties:
        message:
          type: string
        name:
          type: string
        identifier:
          type: string
        rawStatus:
          type: number
        meta:
          type: object
          additionalProperties: true
      required:
      - message
      - name
      - identifier
      - rawStatus
      x-entrypoint:
        origin: ./src/publicApi
        sourcePath: ./src/publicApi/main.yaml
        title: Error
        virtualPath: components/Error
      title: Error
  securitySchemes:
    api_key:
      type: apiKey
      description: "API key authentication for public API requests.\n\nKeys come in two flavors:\n\n- *Legal-entity-scoped keys* are pinned to a single legal entity.\n  Minted via the dashboard under a specific entity; every request\n  acts on that entity.\n- *User-scoped keys* are pinned to a user and span every legal\n  entity that user has access to. Every request made with a\n  user-scoped key (except `GET /legal-entity`, which lists the\n  legal entities the user can access) must include an\n  `x-legal-entity` header naming the legal entity the request is\n  operating on. Requests without the header are rejected with\n  `400`. The authenticated user must have an active permission\n  role on the supplied legal entity, otherwise the request is\n  rejected with `403`.\n"
      name: X-API-Key
      in: header
    partner_api_key:
      type: apiKey
      description: 'Partner-program API key authentication.


        Keys are minted in the partner dashboard (Developers → API Keys),

        are scoped to a single partner program, and are prefixed with

        `sk_partner_`. Partner keys are only accepted by routes that

        declare this scheme; they are rejected by `api_key` routes and

        vice versa.

        '
      name: X-API-Key
      in: header
    bearer:
      type: http
      scheme: bearer
    developer_application:
      type: http
      scheme: basic