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

# Export an entry to a format

> Convert a silo entry's GOBL envelope into an external format, such as UBL or CII,
optionally embedding the entry's files. Nothing is stored: use the "silo.export"
workflow action to keep the result as one of the entry's files. The response is the
converted document as a raw download, with the key of the format used in the
"GOBL-Convert-Format" header.

Convert a silo entry's GOBL envelope into an external format, such as UBL or CII, and download the result. Nothing is stored: to keep the converted document as one of the entry's files, use the `silo.export` workflow action instead.

Choose formats by their `key` from the [conversion formats](https://docs.invopop.com/api-ref/silo/gobl/convert-formats.md) endpoint, escaping each `+` as `%2B`. List several in order of preference and the first that accepts the document is used. The `GOBL-Convert-Format` response header names the format chosen.

To embed the entry's files in the exported document, set `attachments` to `all`, or to a single file category: `format` or `attachment`. Use `mime` to limit them to particular types:

```bash theme={"system"}
curl "https://api.invopop.com/silo/v1/entries/$ENTRY_ID/export?format=ubl%2Bpeppol%2Bbis-v3&attachments=all&mime=application/pdf" \
  -H "Authorization: Bearer $INVOPOP_TOKEN" \
  -o invoice.xml
```


## OpenAPI

````yaml GET /silo/v1/entries/{id}/export
openapi: 3.0.0
info:
  contact:
    email: dev@invopop.com
    name: Invopop Developers
  description: >-
    Store and manage GOBL documents along with their attachments in "Silo
    Entries".
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  title: Silo Service API
  version: 1.0.0
servers:
  - description: production
    url: https://api.invopop.com
security:
  - authToken: []
paths:
  /silo/v1/entries/{id}/export:
    get:
      description: >-
        Convert a silo entry's GOBL envelope into an external format, such as
        UBL or CII,

        optionally embedding the entry's files. Nothing is stored: use the
        "silo.export"

        workflow action to keep the result as one of the entry's files. The
        response is the

        converted document as a raw download, with the key of the format used in
        the

        "GOBL-Convert-Format" header.
      parameters:
        - description: >-
            Key of the format to export to, as listed by /gobl/convert/formats.
            Repeat the parameter, or separate keys with commas, to offer several
            in order of preference: the first that accepts the document is used.
          in: query
          name: format
          required: true
          schema:
            description: >-
              Key of the format to export to, as listed by
              /gobl/convert/formats. Repeat the parameter, or separate keys with
              commas, to offer several in order of preference: the first that
              accepts the document is used.
            example:
              - ubl+peppol+bis-v3
            items:
              type: string
            title: Format
            type: array
        - description: >-
            Category of the entry's files to embed in the exported document.
            None are embedded when omitted.
          in: query
          name: attachments
          schema:
            description: >-
              Category of the entry's files to embed in the exported document.
              None are embedded when omitted.
            enum:
              - all
              - format
              - attachment
            title: Attachments
            type: string
        - description: Only embed files of these MIME types, any when omitted.
          in: query
          name: mime
          schema:
            description: Only embed files of these MIME types, any when omitted.
            example:
              - application/pdf
            items:
              type: string
            title: MIME
            type: array
        - description: UUID of the silo entry to export.
          in: path
          name: id
          required: true
          schema:
            description: UUID of the silo entry to export.
            example: 347c5b04-cde2-11ed-afa1-0242ac120002
            title: ID
            type: string
      responses:
        '200':
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
          description: >-
            The exported document. Content type and disposition are set
            according to the format.
components:
  securitySchemes:
    authToken:
      bearerFormat: JWT
      description: >-
        Use the `Bearer` scheme with a valid JWT token to authenticate requests.
        Example: `Authorization: Bearer <token>`
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.