> 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/urls/resolve-a-url-to-an-embed.md).

# Resolve a URL to an embed

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"urls","description":"Manage official endpoints, direct deep links, or short links for your content. This allows you to keep track of multiple custom URLs or vanity links under one system.\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]},{"user-internal":[]},{"user-staff":[]},{"integration":[]},{"integration-installation":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"},"user-internal":{"type":"http","scheme":"bearer"},"user-staff":{"type":"http","scheme":"bearer"},"integration":{"type":"http","scheme":"bearer"},"integration-installation":{"type":"http","scheme":"bearer"}},"schemas":{"Embed":{"allOf":[{"type":"object","properties":{"title":{"type":"string"},"site":{"type":"string"},"icon":{"type":"string"}},"required":["title","site"]},{"oneOf":[{"type":"object","title":"Link","properties":{"type":{"type":"string","enum":["link"]}},"required":["type"]},{"type":"object","title":"HTML","properties":{"type":{"type":"string","enum":["rich"]},"html":{"type":"string"}},"required":["type","html"]},{"type":"object","title":"Integration","properties":{"type":{"type":"string","enum":["integration"]},"integration":{"description":"The identifier of the integration performing the rendering","type":"string"},"block":{"$ref":"#/components/schemas/IntegrationBlock"}},"required":["type","integration","block"]}]}]},"IntegrationBlock":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID in the integration for the block. It also represents the UI component used."},"title":{"type":"string","description":"Short descriptive title for the block.","minLength":2,"maxLength":40},"description":{"type":"string","description":"Long descriptive text for the block.","minLength":0,"maxLength":150},"icon":{"type":"string","description":"URL of the icon to represent this block."},"urlUnfurl":{"type":"array","description":"URLs patterns to convert as this block.","items":{"type":"string"}},"markdown":{"$ref":"#/components/schemas/IntegrationBlockMarkdown"}},"required":["id","title"]},"IntegrationBlockMarkdown":{"oneOf":[{"type":"object","description":"Format the custom block as a codeblock","properties":{"codeblock":{"description":"Code block syntax to use to identify the block.","type":"string"},"body":{"description":"Key of the property to use as body of the codeblock.","type":"string"}},"required":["codeblock","body"]}]}}},"paths":{"/urls/embed":{"get":{"operationId":"getEmbedByUrl","summary":"Resolve a URL to an embed","tags":["urls"],"parameters":[{"name":"url","in":"query","required":true,"description":"URL to resolve","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Embed"}}}}}}}}}
```


---

# 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 dynamically by asking a question.

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

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/urls/resolve-a-url-to-an-embed.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
