# Start a resumable upload

`POST /assets/uploads` · Rivier · files

Start a resumable upload.

- Scope: files:write
- Graphql: Mutation.filesUploadBegin
- Sdk: files.upload.begin
- Cli: files upload begin

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "bytes": {
      "type": "integer",
      "minimum": 1
    },
    "sha256": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{64}$"
    },
    "assetId": {
      "type": "string",
      "format": "uuid"
    },
    "partBytes": {
      "type": "integer"
    },
    "note": {
      "type": "string",
      "maxLength": 300
    },
    "grant": {
      "type": "object",
      "properties": {
        "minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 60
        }
      },
      "additionalProperties": false
    },
    "kind": {
      "type": "string",
      "enum": [
        "logo",
        "mark",
        "lockup",
        "wordmark",
        "favicon",
        "palette",
        "typography",
        "guideline",
        "voice",
        "imagery",
        "persona_sheet",
        "avatar",
        "template",
        "font",
        "document",
        "video",
        "audio",
        "image",
        "other"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 2000
    },
    "altText": {
      "type": "string",
      "maxLength": 1500
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
      },
      "maxItems": 40
    },
    "licence": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "holder": {
              "type": "string",
              "maxLength": 200
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri",
              "maxLength": 1000
            },
            "terms": {
              "type": "string",
              "maxLength": 2000
            },
            "attribution": {
              "type": "string",
              "maxLength": 500
            },
            "scope": {
              "type": "string",
              "maxLength": 500
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "rightsExpiresAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "ai": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "generated": {
              "type": "boolean"
            },
            "model": {
              "type": "string",
              "maxLength": 120
            },
            "tool": {
              "type": "string",
              "maxLength": 120
            },
            "generatedAt": {
              "type": "string",
              "format": "date-time"
            },
            "promptRef": {
              "type": "string",
              "maxLength": 300
            },
            "note": {
              "type": "string",
              "maxLength": 500
            }
          },
          "required": [
            "generated"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "disclosureLine": {
      "type": "string",
      "maxLength": 400
    },
    "provenance": {
      "type": "object",
      "properties": {
        "originPath": {
          "type": "string",
          "maxLength": 500
        },
        "sourceRef": {
          "type": "string",
          "maxLength": 500
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri",
          "maxLength": 1000
        },
        "importedFrom": {
          "type": "string",
          "maxLength": 200
        },
        "note": {
          "type": "string",
          "maxLength": 500
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "bytes"
  ],
  "additionalProperties": true
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/assets/uploads' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "bytes": 0
}'
```
