---
title: Create a Link
slug: pfm/create-a-link
createdAt: 2023-11-21T07:26:39.314Z
---

:::ApiMethodV2
```json
{
  "name": "links",
  "method": "POST",
  "url": "https://api-sandbox.klavi.ai/pfm/v1/links",
  "description": "Create a link by accessToken",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "sqUhPCBElt0jkpFkovLUY",
        "language": "curl",
        "code": "curl --location 'https://api-sandbox.klavi.ai/pfm/v1/links' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\"personalTaxId\":\"string\",\"redirectURL\":\"string\",\"externalInfo\":\"Object\"}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "sqUhPCBElt0jkpFkovLUY"
  },
  "results": {
    "languages": [
      {
        "id": "V0F3xDKIkgPjNb3Dy14d2",
        "language": "200",
        "code": "{\n    \"pfmId\": \"7dde305a-ae1a-4058-81e2-14b1f7dc1d90\",\n    \"pfmURL\": \"https://open-sandbox.klavi.ai/pfm?pfmToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTQ0ODUyMzEsImlhdCI6MTc5NDQ4MzQzMSwiaXNzIjoia2xhdmkiLCJwYXJ0bmVyQXBwSUQiOiJvZnBmZGVtbyIsInBhcnRuZXJDb2RlIjoib2ZEZW1vIiwicGZtSWQiOiI3ZGRlMzA1YS1hZTFhLTQwNTgtODFlMi0xNGIxZjdkYzFkOTAiLCJzdWIiOiJrbGF2aSJ9.zBcvCSwXokQ2HcWP1bWG4d02Cve01NVhFreFPGFAUUY&refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTQ1Njk4MzEsImlhdCI6MTc5NDQ4MzQzMSwiaXNzIjoia2xhdmkiLCJwYXJ0bmVyQXBwSUQiOiJvZnBmZGVtbyIsInBhcnRuZXJDb2RlIjoib2ZEZW1vIiwicGZtSWQiOiI3ZGRlMzA1YS1hZTFhLTQwNTgtODFlMi0xNGIxZjdkYzFkOTAiLCJzdWIiOiJrbGF2aSJ9.lmaMeKC8f5mtaqXvpYpPP92ti6e_ORuA9JMEAt1wlw4\",\n    \"pfmToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTQ0ODUyMzEsImlhdCI6MTc5NDQ4MzQzMSwiaXNzIjoia2xhdmkiLCJwYXJ0bmVyQXBwSUQiOiJvZnBmZGVtbyIsInBhcnRuZXJDb2RlIjoib2ZEZW1vIiwicGZtSWQiOiI3ZGRlMzA1YS1hZTFhLTQwNTgtODFlMi0xNGIxZjdkYzFkOTAiLCJzdWIiOiJrbGF2aSJ9.zBcvCSwXokQ2HcWP1bWG4d02Cve01NVhFreFPGFAUUY\",\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTQ1Njk4MzEsImlhdCI6MTc5NDQ4MzQzMSwiaXNzIjoia2xhdmkiLCJwYXJ0bmVyQXBwSUQiOiJvZnBmZGVtbyIsInBhcnRuZXJDb2RlIjoib2ZEZW1vIiwicGZtSWQiOiI3ZGRlMzA1YS1hZTFhLTQwNTgtODFlMi0xNGIxZjdkYzFkOTAiLCJzdWIiOiJrbGF2aSJ9.lmaMeKC8f5mtaqXvpYpPP92ti6e_ORuA9JMEAt1wlw4\",\n    \"expireIn\": 1800,\n    \"refreshExpireIn\": 86400\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "V0F3xDKIkgPjNb3Dy14d2"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "Authorization",
        "kind": "required",
        "type": "string",
        "description": "Bearer access token, it returned by the /auth",
        "children": []
      }
    ],
    "bodyDataParameters": [
      {
        "name": "personalTaxId",
        "kind": "required",
        "type": "string",
        "description": "The CPF of the end-user, for Personal Accounts only",
        "": "required"
      },
      {
        "name": "redirectURL",
        "kind": "required",
        "type": "string",
        "description": "Used by end-user to navigate back to the customer page from the PFM page.",
        "": "required"
      },
      {
        "name": "externalInfo",
        "kind": "optional",
        "type": "Object",
        "description": "Used for partners to transmit information. \n",
        "children": [],
        "": "Used for partners to transmit information. \n"
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "response": [
    {
      "name": "pfmId",
      "kind": "optional",
      "type": "string",
      "description": "Unique identifier for the created link"
    },
    {
      "name": "pfmURL",
      "kind": "optional",
      "type": "string",
      "description": "The Whitelabel application URL generated by Klavi for the partner, it can be opened as long as the partner's front-end requests this URL",
      "children": []
    },
    {
      "name": "pfmToken",
      "kind": "optional",
      "type": "string",
      "description": "The token of the created link\nYou can think that the backend system will use accessToken(generated by /auth), while the front-end system will use this pfmToken.",
      "children": []
    },
    {
      "name": "expireIn",
      "kind": "optional",
      "type": "string",
      "description": "Lifetime of the pfmToken in seconds. Defaults to 1800 seconds (30 minutes).",
      "children": []
    },
    {
      "name": "refreshToken",
      "kind": "optional",
      "type": "string",
      "description": "Token used to obtain a new pfmToken when the current one expires.",
      "children": []
    },
    {
      "name": "refreshExpireIn",
      "kind": "optional",
      "type": "string",
      "description": "Lifetime of the refreshToken in seconds. Defaults to 86400 seconds (24 hours).",
      "children": []
    }
  ],
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "links",
  "legacyHash": "fNS849ea7VTwAiDpb-CqO"
}
```
:::



##

