---
title: Refresh access token
slug: refresh-access-token
docTags: 
createdAt: 2026-04-17T07:48:39.600Z
---

{
  "id": "bl_3J-m_GgB0jGy3EIZp5",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.archbee.com/v2/auth/token/refresh",
    "servers": [
      {
        "url": "https://api.archbee.com/v2/auth/token/refresh",
        "description": "Production server"
      },
      {
        "url": "https://staging-api.archbee.com/v2/auth/token/refresh",
        "description": "Staging server"
      },
      {
        "url": "https://{region}.api.archbee.com/{version}/auth/token/refresh",
        "description": "Regional server with variables"
      }
    ],
    "name": "Refresh access token",
    "description": "<p>Uses a refresh token to obtain a new access token. Requires cookie-based auth.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "grantType",
              "kind": "optional",
              "type": "string<refresh_token>",
              "description": "",
              "example": "",
              "default": "refresh_token",
              "enum": [
                "refresh_token"
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyCookie",
          "name": "session_token",
          "kind": "optional",
          "type": "apiKey",
          "description": "API key passed as a cookie",
          "in": "cookie"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "New tokens issued",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "TokenResponse",
            "schema": [
              {
                "name": "accessToken",
                "kind": "optional",
                "type": "string",
                "description": "JWT access token",
                "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
              },
              {
                "name": "refreshToken",
                "kind": "optional",
                "type": "string",
                "description": "Refresh token for obtaining new access tokens",
                "example": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..."
              },
              {
                "name": "tokenType",
                "kind": "optional",
                "type": "string<Bearer>",
                "description": "",
                "example": "Bearer",
                "enum": [
                  "Bearer"
                ]
              },
              {
                "name": "expiresIn",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "Token lifetime in seconds",
                "example": 3600,
                "format": "int32"
              }
            ],
            "modelRef": "#/components/schemas/TokenResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized — missing or invalid authentication credentials",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"UNAUTHORIZED\",\"message\":\"Authentication credentials are missing or invalid\"}",
            "description": "Standard error response",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "Machine-readable error code",
                "example": "VALIDATION_ERROR"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Human-readable error message",
                "example": "The request body contains invalid fields"
              },
              {
                "name": "details",
                "kind": "optional",
                "type": "array",
                "description": "Detailed validation errors (when applicable)",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "field",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "email"
                  },
                  {
                    "name": "message",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "must be a valid email address"
                  },
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "INVALID_FORMAT"
                  }
                ]
              },
              {
                "name": "requestId",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "Correlation ID for support inquiries",
                "example": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "FHBi_KDfKjxZAuM2P9Oso",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.archbee.com/v2/auth/token/refresh \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"grantType\": \"refresh_token\"\n     }'"
        },
        {
          "id": "0n6Rc2Q8XXxmi_Of2tUDM",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"grantType\": \"refresh_token\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.archbee.com/v2/auth/token/refresh\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "yfzo3_MRdQMmU5riWwLtk",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.archbee.com/v2/auth/token/refresh\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"grantType\": \"refresh_token\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "5Sx1K2Lm795cj-UD-UVec",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.archbee.com/v2/auth/token/refresh\"\n\npayload = json.dumps({\n   \"grantType\": \"refresh_token\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "FHBi_KDfKjxZAuM2P9Oso"
    },
    "results": {
      "languages": [
        {
          "id": "eeXg_0gRve8hupbEHrp7X",
          "language": "200",
          "code": "// New tokens issued\n{\n  \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n  \"refreshToken\": \"dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...\",\n  \"tokenType\": \"Bearer\",\n  \"expiresIn\": 3600\n}"
        },
        {
          "id": "YUTSCLI48sSHInOU2_Yq7",
          "language": "401",
          "code": "// Unauthorized — missing or invalid authentication credentials\n{\n  \"code\": \"VALIDATION_ERROR\",\n  \"message\": \"The request body contains invalid fields\",\n  \"details\": [\n    {\n      \"field\": \"email\",\n      \"message\": \"must be a valid email address\",\n      \"code\": \"INVALID_FORMAT\"\n    }\n  ],\n  \"requestId\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "eeXg_0gRve8hupbEHrp7X"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}