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

# Decline Invitation

POST https://api.catenatelematics.com/v2/orgs/invitations/{invitation_id}/decline
Content-Type: application/json

Decline an invitation to share data after being invited by a partner.

Reference: https://catena.ferndocs.com/api-reference/orgs/invitations/decline-invitation

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `invitation_id` (string, required)

### Body (application/json)

This endpoint expects an InvitationDecline.

- `decline_reason` (string, optional, nullable) — Reason for declining the invitation (e.g., 'Not interested', 'Already using another service')

## Response

### 200

Successful Response

- `id` (string, required) — Unique invitation identifier
- `created_at` (datetime, required) — When the invitation was created
- `magic_link` (string, required) — The magic link that is used to open Catena Connect and accept the invitation. Share this URL with the fleet to begin onboarding.
- `expires_at` (datetime, required) — The expiration date and time of the invitation
- `expires_in_hours` (integer, required) — The number of hours the invitation is valid for.
- `status` (enum, required) — The current status of the invitation (active, accepted, declined, or expired)
  - Allowed values: `active`, `accepted`, `declined`, `expired`, `deleted`
- `fleet_name` (string, required, nullable) — Pre-populate the fleet name during onboarding. The fleet can modify this during acceptance.
- `accepted_at` (datetime, required, nullable) — The date and time the invitation was accepted. Null if not accepted.
- `pre_registration_access_token` (string, required, nullable) — The JWT token used to pre-register the fleet. It allows the fleet to create connections after accepting the invitation even without registering a user. Value is set after the invitation is accepted.
- `pre_registration_refresh_token` (string, required, nullable) — The refresh token used to pre-register the fleet. It allows the fleet to create connections after accepting the invitation even without registering a user. Value is set after the invitation is accepted.
- `callback_url` (string, required, nullable) — Your webhook endpoint to receive real-time notifications for invitation acceptance, share agreement creation, and connection status updates. Must be HTTPS.
- `success_redirect_url` (string, required, nullable) — The URL to redirect the user to after onboarding successfully on Catena Connect. **Available query parameters:** `invitation_id`, `fleet_ref`.
- `failure_redirect_url` (string, required, nullable) — The URL to redirect the user to after failing to onboard on Catena Connect (i.e. declining an invitation, opening an expired invitation, etc). **Available query parameters:** `invitation_id`, `fleet_ref`.
- `limit_tsps` (list of string, required, nullable) — Restrict which telematics providers the fleet can connect to. Useful if you only need data from specific TSPs. If omitted, all available TSPs are shown.
- `exclude_tsps` (list of string, required, nullable) — Exclude specific telematics providers from the ones shown to the fleet. Useful if you want the fleet to have access to every TSP except a few.
- `partner_slug` (string, required, nullable) — The slug of your organization
- `partner_id` (string, required) — Your organization ID requesting access to fleet data
- `decline_reason` (string, required, nullable) — The reason provided by the fleet for declining the invitation. Null if invitation was not declined.
- `declined_at` (datetime, required, nullable) — The date the invitation was declined by the fleet. Null if invitation was not declined.
- `fleet_ref` (string, required) — Your internal fleet identifier. Use this to map Catena fleets back to your system. This value will be returned in webhooks and redirect URLs.
- `permissions` (map from string to enum, required) — Defines which resources (vehicle, locations, users, etc.) the fleet must grant access to and the permission level (read, write) for each.
  - Allowed values: `read`, `read_write`
- `fleet_email` (string, required, nullable) — The contact email for the fleet.
- `fleet_regulatory_id` (string, required, nullable) — The fleet's regulatory identifier (e.g., DOT number).
- `fleet_regulatory_id_type` (string, required, nullable) — The type of regulatory ID (e.g., 'DOT', 'MC').
- `fleet_phone` (string, required, nullable) — The phone number for the fleet.
- `fleet_website` (string, required, nullable) — The website URL for the fleet.
- `fleet_country_code` (string, required, nullable) — The ISO 3166-1 alpha-3 country code for the fleet.
- `partner_provided_fleet_name` (string, required, nullable, deprecated) — Deprecated: Use `fleet_name` instead.
- `partner_provided_fleet_email` (string, required, nullable, deprecated) — Deprecated: Use `fleet_email` instead.
- `partner_provided_fleet_regulatory_id` (string, required, nullable, deprecated) — Deprecated: Use `fleet_regulatory_id` instead.
- `partner_provided_fleet_regulatory_id_type` (string, required, nullable, deprecated) — Deprecated: Use `fleet_regulatory_id_type` instead.
- `partner_provided_fleet_phone` (string, required, nullable, deprecated) — Deprecated: Use `fleet_phone` instead.
- `partner_provided_fleet_website` (string, required, nullable, deprecated) — Deprecated: Use `fleet_website` instead.
- `partner_provided_fleet_country_code` (string, required, nullable, deprecated) — Deprecated: Use `fleet_country_code` instead.
- `fleet_id` (string, optional, nullable) — The Catena fleet ID created after accepting the invitation. Null if invitation has not been accepted.

## Errors

### 400 Bad Request Error

Bad Request

- `code` (integer, optional, default: 400)
- `message` (string, optional, default: Bad Request)
- `detail` (string, optional, nullable)

### 401 Unauthorized Error

Unauthorized

- `code` (integer, optional, default: 401)
- `message` (string, optional, default: Unauthorized)
- `detail` (string, optional, nullable)

### 403 Forbidden Error

Forbidden

- `code` (integer, optional, default: 403)
- `message` (string, optional, default: Forbidden)
- `detail` (string, optional, nullable)

### 404 Not Found Error

Not Found

- `code` (integer, optional, default: 404)
- `message` (string, optional, default: Not Found)
- `detail` (string, optional, nullable)

### 405 Method Not Allowed Error

Method Not Allowed

- `code` (integer, optional, default: 405)
- `message` (string, optional, default: Method Not Allowed)
- `detail` (string, optional, nullable)

### 409 Conflict Error

Conflict

- `code` (integer, optional, default: 409)
- `message` (string, optional, default: Conflict)
- `detail` (string, optional, nullable)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `code` (integer, optional, default: 422)
- `message` (string, optional, default: Invalid Request Body)
- `detail` (list of ValidationErrorDetail, optional, nullable)

### 429 Too Many Requests Error

Too Many Requests

- `code` (integer, optional, default: 429)
- `message` (string, optional, default: Too Many Requests)
- `detail` (RetryAfterDetail, optional, nullable)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional, default: Internal Server Error)

## Types

### ValidationErrorDetail

- `path` (string, required)
- `input` (string, required)
- `message` (string, required)
- `error_type` (string, required)

### RetryAfterDetail

- `retry_after_seconds` (integer, required)
- `message` (string, required)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "created_at": "2025-12-11T10:30:00Z",
  "magic_link": "https://connect.catenatelematics.com/?invite=01234567-89ab-cdef-0123-456789abcdef",
  "expires_at": "2025-12-12T10:30:00Z",
  "expires_in_hours": 24,
  "status": "accepted",
  "fleet_name": "Swift Transport LLC",
  "accepted_at": "2025-12-11T14:22:00Z",
  "pre_registration_access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "pre_registration_refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "callback_url": "https://api.example.com/webhooks/catena",
  "success_redirect_url": "https://app.example.com/onboarding/success",
  "failure_redirect_url": "https://app.example.com/onboarding/failure",
  "limit_tsps": [
    "samsara",
    "geotab"
  ],
  "exclude_tsps": [
    "string"
  ],
  "partner_slug": "acme-logistics",
  "partner_id": "11223344-5566-7788-99aa-bbccddeeff00",
  "decline_reason": "string",
  "declined_at": "2024-01-15T09:30:00Z",
  "fleet_ref": "FLEET-12345",
  "permissions": {
    "hos_events": "read",
    "user": "read_write",
    "vehicle": "read_write",
    "vehicle_location": "read"
  },
  "fleet_email": "string",
  "fleet_regulatory_id": "string",
  "fleet_regulatory_id_type": "string",
  "fleet_phone": "string",
  "fleet_website": "string",
  "fleet_country_code": "string",
  "partner_provided_fleet_name": "string",
  "partner_provided_fleet_email": "string",
  "partner_provided_fleet_regulatory_id": "string",
  "partner_provided_fleet_regulatory_id_type": "string",
  "partner_provided_fleet_phone": "string",
  "partner_provided_fleet_website": "string",
  "partner_provided_fleet_country_code": "string",
  "fleet_id": "98765432-10fe-dcba-9876-543210fedcba"
}
```

**SDK Code**

```python
import requests

url = "https://api.catenatelematics.com/v2/orgs/invitations/invitation_id/decline"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.catenatelematics.com/v2/orgs/invitations/invitation_id/decline';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.catenatelematics.com/v2/orgs/invitations/invitation_id/decline"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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.catenatelematics.com/v2/orgs/invitations/invitation_id/decline")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.catenatelematics.com/v2/orgs/invitations/invitation_id/decline")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.catenatelematics.com/v2/orgs/invitations/invitation_id/decline', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.catenatelematics.com/v2/orgs/invitations/invitation_id/decline");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.catenatelematics.com/v2/orgs/invitations/invitation_id/decline")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```