> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.kiwiform.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.kiwiform.com/_mcp/server.

# Get Access Token

POST https://app.kiwiform.com/api/zapier/token
Content-Type: application/x-www-form-urlencoded

### **Overview**

Exchanges an authorization code or a refresh token for a persistent access token. This is the first step in interacting with the KiwiForm API.

### **Request Body (form-data)**

| Key | Type | Description |
| --- | --- | --- |
| `grant_type` | `string` | **Required.** Use `authorization_code` or `refresh_token`. |
| `client_id` | `string` | Your unique Application Client ID. **Required** for `authorization_code`. Optional for `refresh_token`. |
| `client_secret` | `string` | Your Application Secret Key. **Required** for `authorization_code`. Optional for `refresh_token`. |
| `code` | `string` | Required if `grant_type` is `authorization_code`. |
| `refresh_token` | `string` | Required if `grant_type` is `refresh_token`. |

### **Response Attributes**

- `access_token` (string): The token used for authentication.
    
- `refresh_token` (string): Token used to obtain a new access token.
    
- `expires_in` (integer): Time in seconds until the token expires.

Reference: https://developers.kiwiform.com/kiwiform-api/kiwiform-zapier-api/get-access-token

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Kiwiform API
  version: 1.0.0
paths:
  /api/zapier/token:
    post:
      operationId: get-access-token
      summary: Get Access Token
      description: >-
        ### **Overview**


        Exchanges an authorization code or a refresh token for a persistent
        access token. This is the first step in interacting with the KiwiForm
        API.


        ### **Request Body (form-data)**


        | Key | Type | Description |

        | --- | --- | --- |

        | `grant_type` | `string` | **Required.** Use `authorization_code` or
        `refresh_token`. |

        | `client_id` | `string` | Your unique Application Client ID.
        **Required** for `authorization_code`. Optional for `refresh_token`. |

        | `client_secret` | `string` | Your Application Secret Key. **Required**
        for `authorization_code`. Optional for `refresh_token`. |

        | `code` | `string` | Required if `grant_type` is `authorization_code`.
        |

        | `refresh_token` | `string` | Required if `grant_type` is
        `refresh_token`. |


        ### **Response Attributes**


        - `access_token` (string): The token used for authentication.
            
        - `refresh_token` (string): Token used to obtain a new access token.
            
        - `expires_in` (integer): Time in seconds until the token expires.
      tags:
        - subpackage_kiwiformZapierApi
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Kiwiform Zapier API_Get Access
                  Token_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                client_id:
                  type: string
                client_secret:
                  type: string
                refresh_token:
                  type: string
              required:
                - grant_type
                - client_id
                - client_secret
                - refresh_token
servers:
  - url: https://app.kiwiform.com
    description: https://app.kiwiform.com
components:
  schemas:
    Kiwiform Zapier API_Get Access Token_Response_200:
      type: object
      properties:
        access_token:
          type: string
        refresh_token:
          type: string
        expires_in:
          type: integer
        token_type:
          type: string
      required:
        - access_token
        - refresh_token
        - expires_in
        - token_type
      title: Kiwiform Zapier API_Get Access Token_Response_200

```

## Examples



**Request**

```json
{
  "grant_type": "refresh_token",
  "client_id": "abc123xyz789",
  "client_secret": "s3cr3tK3y!@#",
  "refresh_token": "rtk_9f8e7d6c5b4a3"
}
```

**Response**

```json
{
  "access_token": "atk_4f3e2d1c0b9a8",
  "refresh_token": "rtk_9f8e7d6c5b4a3",
  "expires_in": 3600,
  "token_type": "Bearer"
}
```

**SDK Code**

```python Kiwiform Zapier API_Get Access Token_example
import requests

url = "https://app.kiwiform.com/api/zapier/token"

payload = ""
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Kiwiform Zapier API_Get Access Token_example
const url = 'https://app.kiwiform.com/api/zapier/token';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Kiwiform Zapier API_Get Access Token_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.kiwiform.com/api/zapier/token"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Kiwiform Zapier API_Get Access Token_example
require 'uri'
require 'net/http'

url = URI("https://app.kiwiform.com/api/zapier/token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java Kiwiform Zapier API_Get Access Token_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.kiwiform.com/api/zapier/token")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php Kiwiform Zapier API_Get Access Token_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.kiwiform.com/api/zapier/token', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

echo $response->getBody();
```

```csharp Kiwiform Zapier API_Get Access Token_example
using RestSharp;

var client = new RestClient("https://app.kiwiform.com/api/zapier/token");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift Kiwiform Zapier API_Get Access Token_example
import Foundation

let headers = ["Content-Type": "application/x-www-form-urlencoded"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.kiwiform.com/api/zapier/token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```