# Storage

Whether you're hosting images, documents, or other assets, Storage endpoints allow you to integrate those files into your documentation and spaces seamlessly.

## 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"]},"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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
