---
title: "Add smart fields values to redirect URI"
url: "https://docs.signnow.com/docs/smart-fields/operations/post-link-smart-fields"
type: "endpoint"
section: "smart-fields"
slug: "smart-fields/operations/post-link-smart-fields"
method: "POST"
path: "/link"
operation_id: "post-link-smart-fields"
authorization: "bearer"
---

# Add smart fields values to redirect URI

`POST /link`

This endpoint allows API users to add smart field values to the redirect URI via placeholders when creating a link for a template with smart fields.

1. Create a template with smart fields
2. Create a single signing link for the template with `redirect_uri` parameter that contains field placeholders to match field values.

*Example*

```
https://example.com?firstname=[smart_fields.firstname]&lastname=[smart_fields.lastname]

```

## Authorization

bearer

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "document_id"
  ],
  "properties": {
    "document_id": {
      "type": "string",
      "description": "ID of the document or template to create the link for."
    },
    "redirect_uri": {
      "type": "string",
      "description": "The URI that opens after the document is signed. Max: `1500` characters."
    }
  },
  "x-examples": {
    "example-1": {
      "document_id": "{{document_id}}",
      "redirect_uri": "https://google.com?firstname=[smart_fields.firstname]&lastname=[smart_fields.lastname]"
    }
  }
}
```

**Example** (`example-1`)

```json
{
  "document_id": "bff3ceb1dacc9cc7436326f6b513acbc231931c4",
  "redirect_uri": "https://example.com?firstname=[smart_fields.firstname]&lastname=[smart_fields.lastname]"
}
```

## Responses

### 200

Successful response.

**Example** (`Successful response`)

```json
{
  "url": "https://signnow.com/s/Xk2Lm9Qa",
  "url_qrcode": "https://signnow.com/qrcode/Xk2Lm9Qa",
  "url_no_signup": "https://signnow.com/s/Pq7Rt4Zw",
  "url_no_signup_qrcode": "https://signnow.com/qrcode/Pq7Rt4Zw"
}
```

### 400

* Wrong, expired, or missing token.
* `document_id` is missing.
* The document doesn't exist.
* The document belongs to another user.
* The document has no fields.
* Every role in the document has a fixed email address.
* `redirect_uri` isn't a valid URL or is longer than `1500` characters.

**Example** (`No fields`)

```json
{
  "errors": [
    {
      "code": 65594,
      "message": "Cannot create signing links on documents with no fields"
    }
  ]
}
```

**Example** (`Wrong token`)

```json
{
  "code": 1537,
  "error": "invalid_token"
}
```

**Example** (`Not the owner`)

```json
{
  "errors": [
    {
      "code": 65610,
      "message": "User is not document owner"
    }
  ]
}
```

**Example** (`Document not found`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "Document not found"
    }
  ]
}
```

**Example** (`Wrong redirect_uri`)

```json
{
  "errors": [
    {
      "code": 65536,
      "message": "The redirect uri must be a valid url."
    }
  ]
}
```

**Example** (`Missing document_id`)

```json
{
  "errors": [
    {
      "code": 65544,
      "message": "Document ID is required"
    }
  ]
}
```

**Example** (`No unassigned roles`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "A document must have at least one role that does not have a fixed e-mail to create an invite link."
    }
  ]
}
```

**Example** (`redirect_uri too long`)

```json
{
  "errors": [
    {
      "code": 65536,
      "message": "The redirect uri should be less than 1500 characters."
    }
  ]
}
```

## Code Examples

> Replace `$SIGNNOW_ACCESS_TOKEN` and any `{placeholder}` values before running.

### cURL

```bash
curl -X POST \
  "https://api.signnow.com/link" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"document_id": "bff3ceb1dacc9cc7436326f6b513acbc231931c4", "redirect_uri": "https://example.com?firstname=[smart_fields.firstname]&lastname=[smart_fields.lastname]"}'
```

---
*Full reference: https://docs.signnow.com/docs/smart-fields/operations/post-link-smart-fields*
