> For a complete page index, fetch https://developer.close.com/llms.txt

# Create or update a Scheduling Link via OAuth

POST https://api.close.com/api/v1/scheduling_link/integration/
Content-Type: application/json

Please note that only OAuth apps can perform this operation. Using API key will result in an error. See [Authentication with OAuth](https://developer.close.com/api/overview/oauth-authentication) for more information.

Create or update a user scheduling link, managed by your application. Uses the integration-provided `source_id` field to identify and merge duplicate resources created by the same OAuth Application. If a scheduling link created by your OAuth application with the specified `source_id` does not exist, a new one will be created. Otherwise, the scheduling link resource will be updated. Requires authentication via OAuth.

Reference: https://developer.close.com/api/resources/scheduling-links/create-integration

## Authentication

- `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty.
- `Authorization` header (bearer token, required)

## Request

### Body (application/json)

- `any`

## Response

### 200

Successful response

## Examples

**Request**

```json
{
  "description": "Let's find a time to meet!",
  "duration_in_minutes": 60,
  "name": "Chat with Us",
  "source_id": "74241bb7-3436-4228-9b76-392ef7a443ee",
  "source_type": "Multi-Use",
  "url": "https://your-app.example.com/link/example/"
}
```

**Response**

```json
{
  "description": "Let's find a time to meet!",
  "duration_in_minutes": 60,
  "id": "schlnk_2xfNHpU6cjThMuhioZ3GjX",
  "name": "Chat with Us",
  "oauth_client_id": "oa2client_5NvOjgHYKHkbBjv5Rmiyfp",
  "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
  "source": "THIRD_PARTY",
  "source_id": "74241bb7-3436-4228-9b76-392ef7a443ee",
  "source_type": "Multi-Use",
  "template_tag": null,
  "type": "USER",
  "url": "https://your-app.example.com/link/example/",
  "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA"
}
```

**SDK Code**

```python
import requests

url = "https://api.close.com/api/v1/scheduling_link/integration/"

payload = {
    "description": "Let's find a time to meet!",
    "duration_in_minutes": 60,
    "name": "Chat with Us",
    "source_id": "74241bb7-3436-4228-9b76-392ef7a443ee",
    "source_type": "Multi-Use",
    "url": "https://your-app.example.com/link/example/"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript
const url = 'https://api.close.com/api/v1/scheduling_link/integration/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {
  method: 'POST',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"description":"Let\'s find a time to meet!","duration_in_minutes":60,"name":"Chat with Us","source_id":"74241bb7-3436-4228-9b76-392ef7a443ee","source_type":"Multi-Use","url":"https://your-app.example.com/link/example/"}'
};

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

```go
package main

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

func main() {

	url := "https://api.close.com/api/v1/scheduling_link/integration/"

	payload := strings.NewReader("{\n  \"description\": \"Let's find a time to meet!\",\n  \"duration_in_minutes\": 60,\n  \"name\": \"Chat with Us\",\n  \"source_id\": \"74241bb7-3436-4228-9b76-392ef7a443ee\",\n  \"source_type\": \"Multi-Use\",\n  \"url\": \"https://your-app.example.com/link/example/\"\n}")

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

	req.SetBasicAuth("<CLOSE_API_KEY>", "")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/scheduling_link/integration/")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"Let's find a time to meet!\",\n  \"duration_in_minutes\": 60,\n  \"name\": \"Chat with Us\",\n  \"source_id\": \"74241bb7-3436-4228-9b76-392ef7a443ee\",\n  \"source_type\": \"Multi-Use\",\n  \"url\": \"https://your-app.example.com/link/example/\"\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.close.com/api/v1/scheduling_link/integration/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"Let's find a time to meet!\",\n  \"duration_in_minutes\": 60,\n  \"name\": \"Chat with Us\",\n  \"source_id\": \"74241bb7-3436-4228-9b76-392ef7a443ee\",\n  \"source_type\": \"Multi-Use\",\n  \"url\": \"https://your-app.example.com/link/example/\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.close.com/api/v1/scheduling_link/integration/', [
  'body' => '{
  "description": "Let\'s find a time to meet!",
  "duration_in_minutes": 60,
  "name": "Chat with Us",
  "source_id": "74241bb7-3436-4228-9b76-392ef7a443ee",
  "source_type": "Multi-Use",
  "url": "https://your-app.example.com/link/example/"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

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

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/scheduling_link/integration/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"Let's find a time to meet!\",\n  \"duration_in_minutes\": 60,\n  \"name\": \"Chat with Us\",\n  \"source_id\": \"74241bb7-3436-4228-9b76-392ef7a443ee\",\n  \"source_type\": \"Multi-Use\",\n  \"url\": \"https://your-app.example.com/link/example/\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```