> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/developers/gitbook-api/api-reference/storage/create-a-signed-url-to-upload-a-file.md).

# Create a signed URL to upload a file

Generate a pre-signed URL that can be used to upload a file to storage

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"storage","description":"Whether you're hosting images, documents, or other assets, Storage endpoints allow you to integrate those files into your documentation and spaces seamlessly.\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user-internal":[]}],"components":{"securitySchemes":{"user-internal":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"StorageFileMetadata":{"type":"object","properties":{"name":{"type":"string","description":"Original filename"},"type":{"type":"string","description":"MIME type of the file"},"size":{"type":"number","description":"Size of the file in bytes"}},"required":["name","type","size"]},"StorageUploadKind":{"type":"string","enum":["customization_font","import_file","organization_file"]},"StorageUploadURL":{"type":"object","properties":{"object":{"type":"string","description":"The kind of file to upload","enum":["storage-signed-url"]},"url":{"$ref":"#/components/schemas/URL","description":"Presigned URL for uploading the file"},"key":{"type":"string","description":"The bucket object key for the file"}},"required":["object","url","key"]},"URL":{"type":"string","format":"uri","maxLength":2048}},"responses":{"BadRequestError":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[400]},"message":{"type":"string"}},"required":["code","message"]}}}}}}}},"paths":{"/orgs/{organizationId}/storage/upload":{"post":{"operationId":"generateStorageUploadURL","summary":"Create a signed URL to upload a file","description":"Generate a pre-signed URL that can be used to upload a file to storage","tags":["storage"],"parameters":[{"$ref":"#/components/parameters/organizationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file","kind"],"properties":{"file":{"$ref":"#/components/schemas/StorageFileMetadata"},"kind":{"$ref":"#/components/schemas/StorageUploadKind"}}}}}},"responses":{"201":{"description":"Successfully generated signed URL for file upload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUploadURL"}}}},"400":{"$ref":"#/components/responses/BadRequestError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/storage/create-a-signed-url-to-upload-a-file.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
