> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://developers.outpave.com/v1/llms.txt
> - v2: https://developers.outpave.com/v2/llms.txt

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

# Update an allocation

PUT https://api.outpave.com/api/v1/allocations/{id}
Content-Type: application/json

Updates a single allocation. Wrap the entry under `allocation` (same shape used by the create endpoint). Requires **Admin** role and the allocations feature on your company's plan.

Reference: https://developers.outpave.com/api-reference/company-api/allocations/put-api-v-1-allocations-id

## Authentication

- `Authorization` header (bearer token, required) — A short-lived access token from `POST /api/v1/access-token` (30 minutes by default). Send as `Authorization: Bearer <jwt>`.

## Request

### Path parameters

- `id` (string, required) — The allocation's unique identifier.

### Body (application/json)

This endpoint expects an object.

- `allocation` (AllocationEntry, required) — Allocation payload used by both create and update. Provide either `sourceId` or `id`. When `subClass` is `true`, also provide `parentRef.value` or `parentId`.

## Response

### 200

Allocation updated.

- `allocation` (Allocation, required) — An allocation.

## Errors

### 400 Bad Request Error

The request was malformed or failed validation.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 401 Unauthorized Error

The credential is missing, invalid, expired, or doesn't have permission for this endpoint.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 403 Forbidden Error

The credential is valid but doesn't have permission to access this resource, or your plan does not include API access or the feature.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 404 Not Found Error

The requested resource doesn't exist or isn't accessible to your company.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 429 Too Many Requests Error

You've exceeded the rate limit for your API key. Check the `RateLimit-*` headers for your remaining quota.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

### 500 Internal Server Error

An unexpected server error occurred. Retry the request; if the problem persists, contact support.

- `error` (string, required) — A short, human-readable error message.
- `details` (list of string, optional) — Additional error details (returned on validation failures).

## Types

### AllocationEntry

Allocation payload used by both create and update. Provide either `sourceId` or `id`. When `subClass` is `true`, also provide `parentRef.value` or `parentId`.

- `type` (string, required) — The allocation type (e.g. `ClassRef`, `DepartmentRef`).
- `name` (string, optional) — The allocation's display name.
- `fullyQualifiedName` (string, optional) — The fully qualified name, including any parent hierarchy.
- `subClass` (boolean, optional) — Whether this is a sub-class of a parent allocation. When `true`, `parentRef.value` or `parentId` must be provided.
- `parentRef` (AllocationEntryParentRef, optional, nullable) — A reference to the parent allocation by external identifier.
- `parentId` (string, optional) — The parent allocation's unique identifier.
- `sourceId` (string, optional) — The allocation's identifier in your source system (e.g. QuickBooks). One of `sourceId` or `id` is required.
- `id` (string, optional) — The allocation's unique identifier. One of `sourceId` or `id` is required.
- `active` (boolean, optional) — Whether the allocation is active.

### Allocation

An allocation.

- `id` (string, optional) — The allocation's unique identifier.
- `companyId` (string, optional) — The unique identifier of the company that owns the allocation.
- `type` (string, optional) — The allocation type (e.g. `ClassRef`, `DepartmentRef`).
- `typeName` (string, optional) — A human-readable name for the allocation type.
- `name` (string, optional) — The allocation's display name.
- `fullyQualifiedName` (string, optional) — The fully qualified name, including any parent hierarchy.
- `sourceId` (string, optional) — The allocation's identifier in your source system (e.g. QuickBooks).
- `parentId` (string, optional, nullable) — The parent allocation's unique identifier, if any.
- `active` (boolean, optional) — Whether the allocation is currently active.
- `status` (enum, optional) — The allocation's current status.
  - Allowed values: `ACTIVE`, `INACTIVE`
- `createdAt` (long, optional) — Unix timestamp (milliseconds) when the allocation was created.
- `updatedAt` (long, optional) — Unix timestamp (milliseconds) when the allocation was last updated.

### AllocationEntryParentRef

A reference to the parent allocation by external identifier.

- `value` (string, optional) — The parent allocation's external identifier.

## Examples

**Request**

```json
{
  "allocation": {
    "type": "ClassRef"
  }
}
```

**Response**

```json
{
  "allocation": {
    "id": "string",
    "companyId": "string",
    "type": "ClassRef",
    "typeName": "Class",
    "name": "Marketing",
    "fullyQualifiedName": "Marketing",
    "sourceId": "qb-class-1001",
    "parentId": "string",
    "active": true,
    "status": "ACTIVE",
    "createdAt": 1,
    "updatedAt": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.outpave.com/api/v1/allocations/id"

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

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

print(response.json())
```

```javascript
const url = 'https://api.outpave.com/api/v1/allocations/id';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"allocation":{"type":"ClassRef"}}'
};

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.outpave.com/api/v1/allocations/id"

	payload := strings.NewReader("{\n  \"allocation\": {\n    \"type\": \"ClassRef\"\n  }\n}")

	req, _ := http.NewRequest("PUT", 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.outpave.com/api/v1/allocations/id")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"allocation\": {\n    \"type\": \"ClassRef\"\n  }\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.put("https://api.outpave.com/api/v1/allocations/id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"allocation\": {\n    \"type\": \"ClassRef\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.outpave.com/api/v1/allocations/id', [
  'body' => '{
  "allocation": {
    "type": "ClassRef"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.outpave.com/api/v1/allocations/id");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"allocation\": {\n    \"type\": \"ClassRef\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.outpave.com/api/v1/allocations/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```