---
updatedAt: 2026-07-02T10:57:17.000Z
agentTools:
  projectIndex: https://developer.2hire.io/llms.txt
---

# Get Access Token

Access Token used to make API requests

<br />

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "version": "1.0.0",
    "title": "2hireAsAdapter API - Prod",
    "description": "2hireAsAdapter API lets you manage and control one vehicle and a thousand vehicle alike.",
    "contact": {
      "name": "2hire",
      "email": "info@2hire.io",
      "url": "https://2hire.io"
    }
  },
  "servers": [
    {
      "url": "https://adapter.2hire.io"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Get an authentication token"
    }
  ],
  "paths": {
    "/api/v1/auth": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Get Access Token",
        "operationId": "auth",
        "description": "Access Token used to make API requests",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientId",
                  "clientSecret"
                ],
                "properties": {
                  "clientId": {
                    "type": "string",
                    "description": "Client Id",
                    "default": "Insert here your Client Id"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Client Secret",
                    "default": "Insert here your Client Secret"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SuccessAuthResponse"
          },
          "400": {
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "SuccessAuthResponse": {
        "description": "Success Authentication Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SuccessAuthResponse"
            },
            "examples": {
              "success response": {
                "summary": "Success Response",
                "value": {
                  "access_token": "eyJraWQiOiJMOW93TThUMklEdUxBYnVnWHdScjhRUGcyUjN1dDBHYlU4eVRvRUhhTkFzPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiIyMmhjZmUwdGQ3N3EwNzgzdmlkdnVjYnNkdiIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXBpLWdhdGV3YXkubG9jYWxcL2xvZ2luIiwiYXV0aF90aW1lIjoxNjA2ODIxNjI2LCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAuZXUtY2VudHJhbC0xLmFtYXpvbmF3cy5jb21cL2V1LWNlbnRyYWwtMV9NVnc2ejEyUFQiLCJleHAiOjE2MDY4MjUyMjYsImlhdCI6MTYwNjgyMTYyNiwidmVyc2lvbiI6MiwianRpIjoiMmQwZDA1ZWUtOTdiNi00MGJmLWFmNWUtOTA1ODVjM2VjNmVjIiwiY2xpZW50X2lkIjoiMjJoY2ZlMHRkNzdxMDc4M3ZpZHZ1Y2JzZHYifQ.KO9uDeCPijJz74roYQvMGjFeyFsevDWZzx9IRGzVI6ReaDiPvJJtqo2wOPq1_t3CbqJLy30QZEc9Az2f8YjJwLDntB1VX7uBMMBaMRwEw55kMVC6GdVeOq5RkJwuRYpf8bOYC8s5PC8aTItbI6rJnxC9e1IqEmmBQoLktL-PydFL8_RHrB5OaStvtF_cYZ2JfOhzI26aKul5eTPn7IcJzT4NzPNOKDuLOVSxFXkB5Cv7t1QfjBpb050hOM4QYTGN3njQ_gPvZ7du7LffxFlLb8cl1e2Hj6oHjqQ9od8FIMHKeTU_XI85fee1CDgDuUhFizQCvDOyt0NDyarcVU6JDA",
                  "expires_in": "86400",
                  "token_type": "Bearer"
                }
              }
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal Error Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InternalError"
            },
            "examples": {
              "Internal Error": {
                "value": {
                  "code": "INTERNAL_ERROR",
                  "details": {
                    "cause": "INTERNAL_ERROR"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      },
      "BadRequestError": {
        "description": "Bad Request Error Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BadRequestError"
            },
            "examples": {
              "Bad Format": {
                "summary": "Bad Format Error",
                "value": {
                  "code": "BAD_REQUEST_ERROR",
                  "details": {
                    "cause": "BAD_FORMAT"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      },
      "AuthenticationError": {
        "description": "Authentication Error Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AuthenticationError"
            },
            "examples": {
              "Token expired": {
                "summary": "Token Expired",
                "value": {
                  "code": "AUTHENTICATION_ERROR",
                  "details": {
                    "cause": "TOKEN_EXPIRED"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "SuccessAuthResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Access token to use in order to execute API requests"
          },
          "expires_in": {
            "type": "string",
            "description": "Expiration time"
          },
          "token_type": {
            "type": "string",
            "description": "Token type"
          }
        }
      },
      "InternalErrorCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "INTERNAL_ERROR"
            ]
          }
        }
      },
      "QRCodeNotFoundCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "QR_CODE_NOT_FOUND"
            ]
          }
        }
      },
      "InternalError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "INTERNAL_ERROR"
            ]
          },
          "details": {
            "type": "object",
            "oneOf": [
              {
                "$ref": "#/components/schemas/InternalErrorCause"
              },
              {
                "$ref": "#/components/schemas/QRCodeNotFoundCause"
              }
            ]
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "BadRequestCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "BAD_REQUEST"
            ]
          }
        }
      },
      "InvalidUUIDCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "INVALID_UUID"
            ]
          }
        }
      },
      "InvalidSignalNameCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "INVALID_SIGNAL_NAME"
            ]
          }
        }
      },
      "BadFormatCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "BAD_FORMAT"
            ]
          }
        }
      },
      "BadRequestError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "BAD_REQUEST_ERROR"
            ]
          },
          "details": {
            "type": "object",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BadRequestCause"
              },
              {
                "$ref": "#/components/schemas/InvalidUUIDCause"
              },
              {
                "$ref": "#/components/schemas/InvalidSignalNameCause"
              },
              {
                "$ref": "#/components/schemas/BadFormatCause"
              }
            ]
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "AuthenticationError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "AUTHENTICATION_ERROR"
            ]
          },
          "details": {
            "type": "object",
            "properties": {
              "cause": {
                "type": "string",
                "description": "Specific cause of the error",
                "enum": [
                  "HEADER_MALFORMED",
                  "HEADER_MISSING",
                  "TOKEN_AUDIENCE_NOT_ALLOWED",
                  "TOKEN_CREATION_FAILED",
                  "TOKEN_EXPIRED",
                  "TOKEN_KEY_ERROR",
                  "TOKEN_SIGN_ERROR",
                  "TOKEN_VERIFICATION_FAILED",
                  "GET_THIRD_PARTY_TOKEN_FAILED"
                ]
              }
            }
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      }
    }
  }
}
```