> 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.

# Update Tms Invitation

PATCH https://api.catenatelematics.com/v2/orgs/tms-invitations/{tms_invitation_id}
Content-Type: application/json

Update an existing TMS invitation (extend expiration or adjust TMS filters).

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

## Authentication

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

## Request

### Path parameters

- `tms_invitation_id` (string, required)

### Body (application/json)

This endpoint expects a TmsInvitationUpdate.

- `expires_in_hours` (integer, optional, nullable) — How long the invitation link remains valid (1-672 hours).
- `limit_tms` (list of string, optional, nullable) — Restrict which transportation management systems the TMS account can connect to.
- `exclude_tms` (list of string, optional, nullable) — Exclude specific transportation management systems from the ones shown to the TMS account.

## 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 used to accept the invitation. Share this URL with the TMS account 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, expired, or deleted)
  - Allowed values: `active`, `accepted`, `declined`, `expired`, `deleted`
- `tms_account_ref` (string, required) — Your internal identifier for the TMS account. Use this to map Catena TMS accounts back to your system.
- `partner_id` (string, required) — Your organization ID requesting access to TMS account data
- `partner_slug` (string, required, nullable) — The slug of your organization
- `accepted_at` (datetime, required, nullable) — The date and time the invitation was accepted. Null if not accepted.
- `accepted_by` (string, required, nullable) — Identifier of who accepted the invitation on behalf of the TMS account. Null if not accepted.
- `pre_registration_access_token` (string, required, nullable) — The JWT token used to pre-register the TMS account. It allows the TMS account 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 TMS account. It allows the TMS account to create connections after accepting the invitation even without registering a user. Value is set after the invitation is accepted.
- `decline_reason` (string, required, nullable) — The reason provided for declining the invitation. Null if invitation was not declined.
- `declined_at` (datetime, required, nullable) — The date the invitation was declined. Null if invitation was not declined.
- `limit_tms` (list of string, required, nullable) — Restrict which transportation management systems the TMS account can connect to.
- `exclude_tms` (list of string, required, nullable) — Exclude specific transportation management systems from the ones shown to the TMS account.
- `permissions` (map from string to enum, required) — Defines which TMS-sourced resources (loads, shipments, carriers, etc.) the TMS account must grant access to and the permission level for each.
  - Allowed values: `read`, `read_write`
- `tms_account_id` (string, optional, nullable) — The Catena TMS account 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": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "magic_link": "string",
  "expires_at": "2024-01-15T09:30:00Z",
  "expires_in_hours": 1,
  "status": "active",
  "tms_account_ref": "string",
  "partner_id": "string",
  "partner_slug": "string",
  "accepted_at": "2024-01-15T09:30:00Z",
  "accepted_by": "string",
  "pre_registration_access_token": "string",
  "pre_registration_refresh_token": "string",
  "decline_reason": "string",
  "declined_at": "2024-01-15T09:30:00Z",
  "limit_tms": [
    "string"
  ],
  "exclude_tms": [
    "string"
  ],
  "permissions": {},
  "tms_account_id": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.catenatelematics.com/v2/orgs/tms-invitations/tms_invitation_id"

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

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

print(response.json())
```

```javascript
const url = 'https://api.catenatelematics.com/v2/orgs/tms-invitations/tms_invitation_id';
const options = {
  method: 'PATCH',
  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/tms-invitations/tms_invitation_id"

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

	req, _ := http.NewRequest("PATCH", 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/tms-invitations/tms_invitation_id")

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

request = Net::HTTP::Patch.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.patch("https://api.catenatelematics.com/v2/orgs/tms-invitations/tms_invitation_id")
  .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('PATCH', 'https://api.catenatelematics.com/v2/orgs/tms-invitations/tms_invitation_id', [
  '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/tms-invitations/tms_invitation_id");
var request = new RestRequest(Method.PATCH);
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/tms-invitations/tms_invitation_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```