> This page is part of EVVA for Developers (https://developers.evvahub.com), the documentation of the EVVA Partner API. The API is in developer preview and the SDK packages are not yet published: do not suggest installing them. Index: https://developers.evvahub.com/llms.txt

# Create an upload session

POST https://api.evvahub.com/partner/v1/accounts/{creatorId}/media/uploads
Content-Type: application/json

Opens an upload session for one file in the creator's vault.

**Upload flow**

1. Create the session. The answer's `upload` says how to send the bytes.
2. For `upload.method: PUT`, PUT the bytes to `upload.url`. For `MULTIPART`, get part URLs from
   `POST /partner/v1/accounts/{creatorId}/media/uploads/{uploadSessionId}/parts`.
3. Finalize with `POST /partner/v1/accounts/{creatorId}/media/uploads/{uploadSessionId}/finalize`, which turns
   the upload into an asset.

**Errors**

* `409 STORAGE_LIMIT_REACHED` — the creator's vault is full, or this file would overfill it.
* `409 SANDBOX_QUOTA_REACHED` — for a sandbox creator, the agency's sandbox media budget is used up
  ([sandbox](/sandbox)).
* `429 SANDBOX_QUOTA_REACHED` — for a sandbox creator, the agency's hourly sandbox processing budget is used up.

**Required scopes:** `write:media`.

Reference: https://developers.evvahub.com/api-reference/media/create-upload-session

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 client credentials. Request an access token at `POST /partner/v1/oauth/token` (`grant_type=client_credentials`) with the application's client secret or a `private_key_jwt` assertion, then send it as `Authorization: Bearer evpa_live_…` (or `evpa_test_…` for a sandbox application). Tokens are opaque and short lived (see `expires_in`); there is no refresh token. Each operation lists the scopes it requires.

## Request

### Path parameters

- `creatorId` (string, required) — The creator profile id — the ONLY source of the creator a request acts for.

### Headers

- `X-Creator-Id` (string, optional) — Optional echo of the path `creatorId`; any other value is refused with 403 CREATOR_CONTEXT_MISMATCH.

### Body (application/json)

This endpoint expects a CreateUploadRequest.

- `kind` (enum, required)
  - Allowed values: `image`, `video`, `audio`, `document`
- `mimeType` (string, required)
- `sizeBytes` (integer, required)
- `sha256` (string, required)
- `library` (enum, optional, default: public)
  - Allowed values: `public`, `private`
- `supportsResumable` (boolean, optional) — Whether your client can upload in several parts. If it can and the upload is at or above the deployment's threshold, the answer is the `MULTIPART` descriptor. Below the threshold, or when this is not sent, the answer is the one-part `PUT`.

## Response

### 201

Session open.

- `uploadSession` (UploadSessionCreatedUploadSession, required)
- `upload` (UploadSessionCreatedUpload, required)
- `library` (enum, required)
  - Allowed values: `public`, `private`

## Errors

### 400 Bad Request Error

Invalid or missing parameters: `INVALID_REQUEST` (`details` names the fields), or a more specific code of the operation.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 401 Unauthorized Error

Token missing, malformed, expired or revoked: `INVALID_TOKEN` (or `UNAUTHORIZED` when no bearer token was sent). Request a new token and retry.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 403 Forbidden Error

Not your creator, or not with this token: `GRANT_REVOKED` (no active link to the creator), `NOT_ASSIGNED`, `OAUTH_SCOPE_MISSING` (the creator has not consented to the scope), `INSUFFICIENT_SCOPE` (the token lacks it), `CREATOR_CONTEXT_MISMATCH`, `AGENCY_SUSPENDED`.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 409 Conflict Error

`STORAGE_LIMIT_REACHED`: the creator's vault is full, or this file would overfill it. For a sandbox creator the code is `SANDBOX_QUOTA_REACHED` with `resource: sandbox.media.bytes` instead: the agency's sandbox media budget, counting the live assets and open uploads of all its synthetic creators, is used up. A synthetic creator's upload never counts against a vault.

- `CreateUploadSessionRequestConflictError`
  - StorageLimitError: StorageLimitError
  - SandboxQuotaError: SandboxQuotaError

### 429 Too Many Requests Error

The rate limit was hit. For a sandbox creator it can also be `SANDBOX_QUOTA_REACHED` with `resource: sandbox.media.jobs_per_hour`: the agency's hourly sandbox processing budget is used up, and `Retry-After` says when the hour's oldest upload leaves the window.

- `CreateUploadSessionRequestTooManyRequestsError`
  - RateLimitError: RateLimitError
  - SandboxQuotaError: SandboxQuotaError

### 500 Internal Server Error

Unexpected server error: `INTERNAL_ERROR`. Nothing internal is disclosed; quote the `X-Request-Id` when you report it.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 503 Service Unavailable Error

Temporarily unavailable: `SERVICE_UNAVAILABLE`, `TEMPORARILY_UNAVAILABLE`, `MEDIA_STORAGE_UNAVAILABLE` or `CREATOR_STANDING_UNAVAILABLE`. Retry after `Retry-After` seconds.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

## Types

### UploadSessionCreatedUploadSession

- `id` (string, required)
- `kind` (enum, required)
  - Allowed values: `image`, `video`, `audio`, `document`
- `mimeType` (string, required)
- `sizeBytes` (integer, required)
- `expiresAt` (datetime, required)

### UploadSessionCreatedUpload

- UploadSessionCreatedUpload0
- UploadSessionCreatedUpload1

### StorageLimitError

- `code` ("STORAGE_LIMIT_REACHED", required)
- `error` (string, required)
- `usedBytes` (string, required)
- `quotaBytes` (double, required)

### SandboxQuotaError

An upload for a sandbox creator went beyond the agency's sandbox media budget, and nothing was created. `used` and `limit` are decimal strings in the resource's unit: bytes, or upload sessions in the trailing hour. See [the sandbox](/sandbox).

- `code` ("SANDBOX_QUOTA_REACHED", required)
- `error` (string, required)
- `resource` (enum, required)
  - Allowed values: `sandbox.media.bytes`, `sandbox.media.jobs_per_hour`
- `used` (string, required)
- `limit` (string, required)

### RateLimitError

The common error envelope. Branch on `code`; `error` is human-readable and may change.

- `code` (enum, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
  - Allowed values: `RATE_LIMIT_EXCEEDED`, `TOO_MANY_MESSAGES`
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (RateLimitErrorDetails, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### UploadSessionCreatedUpload0

- `method` ("PUT", required)
- `url` (string, required) — A single-use presigned URL (part 1 of a one-part upload).
- `headers` (map from string to string, required)
- `expiresInSec` (integer, required)

### UploadSessionCreatedUpload1

Only when the request declared `supportsResumable`. Sign parts with `signUploadParts`.

- `method` ("MULTIPART", required)
- `partSizeBytes` (integer, required) — Every part except the last is exactly this size.
- `partCount` (integer, required)
- `maxConcurrency` (integer, required)

### RateLimitErrorDetails

Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

- `retryAfterSec` (integer, required)
- `level` (enum, optional) — The DM send limit that refused the message, set only with `TOO_MANY_MESSAGES`. It is never a quota, a count or a key. - `conversation` — one side of one thread. - `sender` — a person's own ceiling; it does not apply to applications. - `creator` — everything sent for the creator, studio included. - `application` — everything your application sends. - `agency` — everything your agency sends. - `platform` — the agency's fair share of the platform: its throughput or its concurrency. See [rate limits](/authentication/rate-limits).
  - Allowed values: `conversation`, `sender`, `creator`, `application`, `agency`, `platform`

## Examples

### Below the multipart threshold (or no supportsResumable) — one presigned PUT

**Response**

```json
{
  "uploadSession": {
    "id": "cm4rh7y2c000rqz8wq3d6l8tv",
    "kind": "image",
    "mimeType": "image/jpeg",
    "sizeBytes": 2483912,
    "expiresAt": "2026-12-02T18:42:07.512Z"
  },
  "upload": {
    "expiresInSec": 600,
    "headers": {
      "Content-Type": "image/jpeg"
    },
    "method": "PUT",
    "url": "https://uploads.example.com/vault/cm4r7k2xq0001qz8w3n5v6b2d/cm4rh7y2c000rqz8wq3d6l8tv?partNumber=1&uploadId=EXAMPLE-UPLOAD-ID-7Fk2&X-Amz-Expires=600&X-Amz-Signature=0000000000example000000000000signature"
  },
  "library": "public"
}
```

**SDK Code**

```python Below the multipart threshold (or no supportsResumable) — one presigned PUT
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```go Below the multipart threshold (or no supportsResumable) — one presigned PUT
package main

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

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```php Below the multipart threshold (or no supportsResumable) — one presigned PUT
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

### supportsResumable: true and a file at or above the threshold — sign parts with signUploadParts

**Response**

```json
{
  "uploadSession": {
    "id": "cm4rh7y2c000rqz8wq3d6l8tv",
    "kind": "video",
    "mimeType": "video/mp4",
    "sizeBytes": 190054400,
    "expiresAt": "2026-12-02T18:42:07.512Z"
  },
  "upload": {
    "maxConcurrency": 4,
    "method": "MULTIPART",
    "partCount": 12,
    "partSizeBytes": 16777216
  },
  "library": "public"
}
```

**SDK Code**

```python supportsResumable: true and a file at or above the threshold — sign parts with signUploadParts
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```go supportsResumable: true and a file at or above the threshold — sign parts with signUploadParts
package main

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

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```php supportsResumable: true and a file at or above the threshold — sign parts with signUploadParts
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

### Media_createUploadSession_example

**Request**

```json
{
  "kind": "image",
  "mimeType": "image/jpeg",
  "sizeBytes": 2483912,
  "sha256": "9f2c4e81b07a5d3c6e18f4a2b9d07c35e6a1f8b4c2d9e07a3b5c1f6e8d4a2b70",
  "library": "public"
}
```

**Response**

```json
{
  "uploadSession": {
    "id": "cm4rh7y2c000rqz8wq3d6l8tv",
    "kind": "image",
    "mimeType": "image/jpeg",
    "sizeBytes": 2483912,
    "expiresAt": "2026-12-02T18:42:07.512Z"
  },
  "upload": {
    "expiresInSec": 600,
    "headers": {
      "Content-Type": "image/jpeg"
    },
    "method": "PUT",
    "url": "https://uploads.example.com/vault/cm4r7k2xq0001qz8w3n5v6b2d/cm4rh7y2c000rqz8wq3d6l8tv?partNumber=1&uploadId=EXAMPLE-UPLOAD-ID-7Fk2&X-Amz-Expires=600&X-Amz-Signature=0000000000example000000000000signature"
  },
  "library": "public"
}
```

**SDK Code**

```python Media_createUploadSession_example
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads"

payload = {
    "kind": "image",
    "mimeType": "image/jpeg",
    "sizeBytes": 2483912,
    "sha256": "9f2c4e81b07a5d3c6e18f4a2b9d07c35e6a1f8b4c2d9e07a3b5c1f6e8d4a2b70",
    "library": "public"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```go Media_createUploadSession_example
package main

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

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads"

	payload := strings.NewReader("{\n  \"kind\": \"image\",\n  \"mimeType\": \"image/jpeg\",\n  \"sizeBytes\": 2483912,\n  \"sha256\": \"9f2c4e81b07a5d3c6e18f4a2b9d07c35e6a1f8b4c2d9e07a3b5c1f6e8d4a2b70\",\n  \"library\": \"public\"\n}")

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

}
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/media/uploads', [
  'body' => '{
  "kind": "image",
  "mimeType": "image/jpeg",
  "sizeBytes": 2483912,
  "sha256": "9f2c4e81b07a5d3c6e18f4a2b9d07c35e6a1f8b4c2d9e07a3b5c1f6e8d4a2b70",
  "library": "public"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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