> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Link

Link defines a link between this document and another resource.

## Schema ID

`https://gobl.org/draft-0/head/link`

## Properties

| Title       | Property      | Type                                | Description                                                                                                                                                                                                     |
| ----------- | ------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UUID        | `uuid`        | string                              | Universally Unique Identifier.                                                                                                                                                                                  |
| Category    | `category`    | [cbc.Key](/draft-0/cbc/key)         | Category helps classify the link according to a fixed list. This is optional but highly recommended as it helps receivers better understand the purpose of the link and potentially how it should be presented. |
|             | `key`         | [cbc.Key](/draft-0/cbc/key)         | Key is a unique identifier for the link within the header and category if provided.                                                                                                                             |
| Code        | `code`        | [cbc.Code](/draft-0/cbc/code)       | Code used to identify the contents of the link.                                                                                                                                                                 |
| Title       | `title`       | string                              | Title of the resource to use when presenting to users.                                                                                                                                                          |
| Description | `description` | string                              | Description of the resource to use when presenting to users.                                                                                                                                                    |
| MIME Type   | `mime`        | string                              | Expected MIME type of the link's content when the content is a file. Can only be one of the allowed types defined by EN 16931-1:2017 plus XML itself.                                                           |
| Digest      | `digest`      | [dsig.Digest](/draft-0/dsig/digest) | Digest is used to verify the integrity of the destination document when downloaded from the URL.                                                                                                                |
| URL         | `url`         | string                              | URL of the resource.                                                                                                                                                                                            |
| Metadata    | `meta`        | [cbc.Meta](/draft-0/cbc/meta)       | Meta contains additional metadata about the link.                                                                                                                                                               |

## Category Values

| Value          | Description                                                                                                                                                    |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `format`       | Alternative formats of the same document, such as PDF, HTML, or XML.                                                                                           |
| `portal`       | Websites that provide access to alternative versions of this document or request modifications. May also allow access to other or previous business documents. |
| `request`      | Documents related to requests submitted to other systems.                                                                                                      |
| `response`     | Response documents sent from third party systems often in reply to requests.                                                                                   |
| `agreement`    | Contracts or agreements related to this document.                                                                                                              |
| `verification` | Evidence or verification documents that can be used to validate the authenticity of this document.                                                             |
| `attachment`   | General attachments for related information such as spread sheets, letters, presentations, specifications, etc.                                                |

## Validation Rules

| Field               | Test                                                                  | Validation Code / Message                                                       |
| ------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| <small>Link</small> | <ul class="gobl-test"><li>No digest without MIME</li></ul>            | `GOBL-HEAD-LINK-06`<br />Link digest must be nil when MIME type is not provided |
| `key`               | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-HEAD-LINK-01`<br />Link key is required                                   |
| `category`          | <ul class="gobl-test"><li>Valid or empty</li></ul>                    | `GOBL-HEAD-LINK-02`<br />Link category is not valid                             |
| `url`               | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-HEAD-LINK-03`<br />Link URL is required                                   |
| `url`               | <ul class="gobl-test"><li>Url</li></ul>                               | `GOBL-HEAD-LINK-04`<br />Link URL must be a valid URL                           |
| `mime`              | <ul class="gobl-test"><li>Valid or empty MIME</li></ul>               | `GOBL-HEAD-LINK-05`<br />Link MIME type is not valid                            |
