{
  "openapi": "3.1.0",
  "info": {
    "title": "Attachment",
    "version": "2025-01-01"
  },
  "servers": [
    {
      "url": "https://client.beeline.com/api"
    },
    {
      "url": "https://client-eu.beeline.com/api"
    }
  ],
  "security": [
    {
      "client_auth": []
    }
  ],
  "tags": [
    {
      "name": "attachment",
      "x-displayName": "Attachment",
      "description": "Retrieve Attachments.\n"
    }
  ],
  "paths": {
    "/sites/{clientSiteId}/attachments/{attachmentId}/data": {
      "parameters": [
        {
          "name": "clientSiteId",
          "in": "path",
          "description": "Uniquely identifies a Beeline VMS instance.",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "example": "abc78252-1d8d-4ecf-9651-6b5ba39bba5b"
        },
        {
          "in": "path",
          "name": "attachmentId",
          "description": "Uniquely identifies an attachment.",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          }
        },
        {
          "name": "api-version",
          "in": "query",
          "description": "The API version of the endpoint",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "2025-01-01"
            ]
          }
        }
      ],
      "get": {
        "operationId": "get-attachment-data",
        "summary": "Attachment Data",
        "tags": [
          "attachment"
        ],
        "description": "Retrieve attachment information from files in Beeline allowing for seamless integration of\nsupporting documents into your enterprise systems for compliance, reporting, and auditing\npurposes. Click [here](webhook-management_2023-07-01#tag/sow-event-types) to see the list of\nattachment events that are available to subscribe to.\n",
        "security": [
          {
            "client_auth": [
              "read:attachment"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment Contents",
            "headers": {
              "Content-Disposition": {
                "description": "Specifies the filename for download.",
                "schema": {
                  "type": "string",
                  "example": "attachment; filename=\"example.pdf\""
                }
              },
              "Content-Length": {
                "description": "Specifies the length of the attachment content.",
                "schema": {
                  "type": "integer",
                  "example": 123456
                }
              },
              "X-Attachment-FileName": {
                "description": "Specifies the filename for download.",
                "schema": {
                  "type": "string",
                  "example": "example.pdf"
                }
              },
              "X-Attachment-MimeType": {
                "description": "Specifies the mime type of the attachment.",
                "schema": {
                  "type": "string",
                  "example": "text/plain"
                }
              },
              "X-Rate-Limit-Limit": {
                "description": "The rate limit period (eg. 1m, 12h, 1d)",
                "schema": {
                  "type": "string"
                },
                "example": "8h"
              },
              "X-Rate-Limit-Remaining": {
                "description": "The number of calls remaining in the time window",
                "schema": {
                  "type": "integer"
                },
                "example": 10
              },
              "X-Rate-Limit-Reset": {
                "description": "UTC date time (ISO 8601) when the limit resets",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "example": "<binary data representation of the attachment>"
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Rate-Limit-Limit": {
                "description": "The rate limit period (eg. 1m, 12h, 1d)",
                "schema": {
                  "type": "string"
                },
                "example": "8h"
              },
              "X-Rate-Limit-Remaining": {
                "description": "The number of calls remaining in the time window",
                "schema": {
                  "type": "integer"
                },
                "example": 10
              },
              "X-Rate-Limit-Reset": {
                "description": "UTC date time (ISO 8601) when the limit resets",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A list of errors.",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "properties": {
                          "code": {
                            "enum": [
                              "UNEXPECTED_ERROR",
                              "VALIDATION_ERROR",
                              "NOT_FOUND",
                              "REQUEST_LIMIT_EXCEEDED",
                              "REQUEST_INVALID_CONTENT_TYPE",
                              "UNSUPPORTED_API_VERSION"
                            ],
                            "type": "string",
                            "description": "One of a server-defined set of error codes."
                          },
                          "message": {
                            "type": "string",
                            "description": "The human-readable representation of the error."
                          },
                          "target": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Rate-Limit-Limit": {
                "description": "The rate limit period (eg. 1m, 12h, 1d)",
                "schema": {
                  "type": "string"
                },
                "example": "8h"
              },
              "X-Rate-Limit-Remaining": {
                "description": "The number of calls remaining in the time window",
                "schema": {
                  "type": "integer"
                },
                "example": 10
              },
              "X-Rate-Limit-Reset": {
                "description": "UTC date time (ISO 8601) when the limit resets",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Rate-Limit-Limit": {
                "description": "The rate limit period (eg. 1m, 12h, 1d)",
                "schema": {
                  "type": "string"
                },
                "example": "8h"
              },
              "X-Rate-Limit-Remaining": {
                "description": "The number of calls remaining in the time window",
                "schema": {
                  "type": "integer"
                },
                "example": 10
              },
              "X-Rate-Limit-Reset": {
                "description": "UTC date time (ISO 8601) when the limit resets",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Rate-Limit-Limit": {
                "description": "The rate limit period (eg. 1m, 12h, 1d)",
                "schema": {
                  "type": "string"
                },
                "example": "8h"
              },
              "X-Rate-Limit-Remaining": {
                "description": "The number of calls remaining in the time window",
                "schema": {
                  "type": "integer"
                },
                "example": 10
              },
              "X-Rate-Limit-Reset": {
                "description": "UTC date time (ISO 8601) when the limit resets",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "A list of errors.",
                      "properties": {
                        "errors": {
                          "type": "array",
                          "items": {
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "properties": {
                              "code": {
                                "enum": [
                                  "UNEXPECTED_ERROR",
                                  "VALIDATION_ERROR",
                                  "NOT_FOUND",
                                  "REQUEST_LIMIT_EXCEEDED",
                                  "REQUEST_INVALID_CONTENT_TYPE",
                                  "UNSUPPORTED_API_VERSION"
                                ],
                                "type": "string",
                                "description": "One of a server-defined set of error codes."
                              },
                              "message": {
                                "type": "string",
                                "description": "The human-readable representation of the error."
                              },
                              "target": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "Retry-After": {
                "description": "The number of seconds remaining when the endpoint can be called again.",
                "schema": {
                  "type": "integer"
                },
                "example": 10
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A list of errors.",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "properties": {
                          "code": {
                            "enum": [
                              "UNEXPECTED_ERROR",
                              "VALIDATION_ERROR",
                              "NOT_FOUND",
                              "REQUEST_LIMIT_EXCEEDED",
                              "REQUEST_INVALID_CONTENT_TYPE",
                              "UNSUPPORTED_API_VERSION"
                            ],
                            "type": "string",
                            "description": "One of a server-defined set of error codes."
                          },
                          "message": {
                            "type": "string",
                            "description": "The human-readable representation of the error."
                          },
                          "target": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "rate-limit": {
                    "value": {
                      "errors": [
                        {
                          "code": "REQUEST_LIMIT_EXCEEDED",
                          "message": "API calls quota exceeded! Maximum admitted 1000 per 1m."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "headers": {
              "X-Rate-Limit-Limit": {
                "description": "The rate limit period (eg. 1m, 12h, 1d)",
                "schema": {
                  "type": "string"
                },
                "example": "8h"
              },
              "X-Rate-Limit-Remaining": {
                "description": "The number of calls remaining in the time window",
                "schema": {
                  "type": "integer"
                },
                "example": 10
              },
              "X-Rate-Limit-Reset": {
                "description": "UTC date time (ISO 8601) when the limit resets",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A list of errors.",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "properties": {
                          "code": {
                            "enum": [
                              "UNEXPECTED_ERROR",
                              "VALIDATION_ERROR",
                              "NOT_FOUND",
                              "REQUEST_LIMIT_EXCEEDED",
                              "REQUEST_INVALID_CONTENT_TYPE",
                              "UNSUPPORTED_API_VERSION"
                            ],
                            "type": "string",
                            "description": "One of a server-defined set of error codes."
                          },
                          "message": {
                            "type": "string",
                            "description": "The human-readable representation of the error."
                          },
                          "target": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "client-site-id": {
        "name": "clientSiteId",
        "in": "path",
        "description": "Uniquely identifies a Beeline VMS instance.",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "abc78252-1d8d-4ecf-9651-6b5ba39bba5b"
      },
      "attachment-id": {
        "in": "path",
        "name": "attachmentId",
        "description": "Uniquely identifies an attachment.",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid",
          "example": "123e4567-e89b-12d3-a456-426614174000"
        }
      },
      "api-version-250101": {
        "name": "api-version",
        "in": "query",
        "description": "The API version of the endpoint",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "2025-01-01"
          ]
        }
      }
    },
    "headers": {
      "rate-limit-limit": {
        "description": "The rate limit period (eg. 1m, 12h, 1d)",
        "schema": {
          "type": "string"
        },
        "example": "8h"
      },
      "rate-limit-remaining": {
        "description": "The number of calls remaining in the time window",
        "schema": {
          "type": "integer"
        },
        "example": 10
      },
      "rate-limit-reset": {
        "description": "UTC date time (ISO 8601) when the limit resets",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "retry-after": {
        "description": "The number of seconds remaining when the endpoint can be called again.",
        "schema": {
          "type": "integer"
        },
        "example": 10
      }
    },
    "responses": {
      "400": {
        "description": "Bad Request",
        "headers": {
          "X-Rate-Limit-Limit": {
            "description": "The rate limit period (eg. 1m, 12h, 1d)",
            "schema": {
              "type": "string"
            },
            "example": "8h"
          },
          "X-Rate-Limit-Remaining": {
            "description": "The number of calls remaining in the time window",
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          "X-Rate-Limit-Reset": {
            "description": "UTC date time (ISO 8601) when the limit resets",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "description": "A list of errors.",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "properties": {
                      "code": {
                        "enum": [
                          "UNEXPECTED_ERROR",
                          "VALIDATION_ERROR",
                          "NOT_FOUND",
                          "REQUEST_LIMIT_EXCEEDED",
                          "REQUEST_INVALID_CONTENT_TYPE",
                          "UNSUPPORTED_API_VERSION"
                        ],
                        "type": "string",
                        "description": "One of a server-defined set of error codes."
                      },
                      "message": {
                        "type": "string",
                        "description": "The human-readable representation of the error."
                      },
                      "target": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "401": {
        "description": "Unauthorized",
        "headers": {
          "X-Rate-Limit-Limit": {
            "description": "The rate limit period (eg. 1m, 12h, 1d)",
            "schema": {
              "type": "string"
            },
            "example": "8h"
          },
          "X-Rate-Limit-Remaining": {
            "description": "The number of calls remaining in the time window",
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          "X-Rate-Limit-Reset": {
            "description": "UTC date time (ISO 8601) when the limit resets",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      },
      "403": {
        "description": "Forbidden",
        "headers": {
          "X-Rate-Limit-Limit": {
            "description": "The rate limit period (eg. 1m, 12h, 1d)",
            "schema": {
              "type": "string"
            },
            "example": "8h"
          },
          "X-Rate-Limit-Remaining": {
            "description": "The number of calls remaining in the time window",
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          "X-Rate-Limit-Reset": {
            "description": "UTC date time (ISO 8601) when the limit resets",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      },
      "404": {
        "description": "Not Found",
        "headers": {
          "X-Rate-Limit-Limit": {
            "description": "The rate limit period (eg. 1m, 12h, 1d)",
            "schema": {
              "type": "string"
            },
            "example": "8h"
          },
          "X-Rate-Limit-Remaining": {
            "description": "The number of calls remaining in the time window",
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          "X-Rate-Limit-Reset": {
            "description": "UTC date time (ISO 8601) when the limit resets",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "type": "object",
                  "description": "A list of errors.",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "properties": {
                          "code": {
                            "enum": [
                              "UNEXPECTED_ERROR",
                              "VALIDATION_ERROR",
                              "NOT_FOUND",
                              "REQUEST_LIMIT_EXCEEDED",
                              "REQUEST_INVALID_CONTENT_TYPE",
                              "UNSUPPORTED_API_VERSION"
                            ],
                            "type": "string",
                            "description": "One of a server-defined set of error codes."
                          },
                          "message": {
                            "type": "string",
                            "description": "The human-readable representation of the error."
                          },
                          "target": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        }
      },
      "429": {
        "description": "Too Many Requests",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds remaining when the endpoint can be called again.",
            "schema": {
              "type": "integer"
            },
            "example": 10
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "description": "A list of errors.",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "properties": {
                      "code": {
                        "enum": [
                          "UNEXPECTED_ERROR",
                          "VALIDATION_ERROR",
                          "NOT_FOUND",
                          "REQUEST_LIMIT_EXCEEDED",
                          "REQUEST_INVALID_CONTENT_TYPE",
                          "UNSUPPORTED_API_VERSION"
                        ],
                        "type": "string",
                        "description": "One of a server-defined set of error codes."
                      },
                      "message": {
                        "type": "string",
                        "description": "The human-readable representation of the error."
                      },
                      "target": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            },
            "examples": {
              "rate-limit": {
                "value": {
                  "errors": [
                    {
                      "code": "REQUEST_LIMIT_EXCEEDED",
                      "message": "API calls quota exceeded! Maximum admitted 1000 per 1m."
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "500": {
        "description": "Internal Server error",
        "headers": {
          "X-Rate-Limit-Limit": {
            "description": "The rate limit period (eg. 1m, 12h, 1d)",
            "schema": {
              "type": "string"
            },
            "example": "8h"
          },
          "X-Rate-Limit-Remaining": {
            "description": "The number of calls remaining in the time window",
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          "X-Rate-Limit-Reset": {
            "description": "UTC date time (ISO 8601) when the limit resets",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "description": "A list of errors.",
              "properties": {
                "errors": {
                  "type": "array",
                  "items": {
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "properties": {
                      "code": {
                        "enum": [
                          "UNEXPECTED_ERROR",
                          "VALIDATION_ERROR",
                          "NOT_FOUND",
                          "REQUEST_LIMIT_EXCEEDED",
                          "REQUEST_INVALID_CONTENT_TYPE",
                          "UNSUPPORTED_API_VERSION"
                        ],
                        "type": "string",
                        "description": "One of a server-defined set of error codes."
                      },
                      "message": {
                        "type": "string",
                        "description": "The human-readable representation of the error."
                      },
                      "target": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "client_auth": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://integrations.auth.beeline.com/oauth/token",
            "scopes": {
              "read:attachment": "Read Attachment data"
            }
          }
        }
      }
    },
    "schemas": {
      "error": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "enum": [
              "UNEXPECTED_ERROR",
              "VALIDATION_ERROR",
              "NOT_FOUND",
              "REQUEST_LIMIT_EXCEEDED",
              "REQUEST_INVALID_CONTENT_TYPE",
              "UNSUPPORTED_API_VERSION"
            ],
            "type": "string",
            "description": "One of a server-defined set of error codes."
          },
          "message": {
            "type": "string",
            "description": "The human-readable representation of the error."
          },
          "target": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "error-response": {
        "type": "object",
        "description": "A list of errors.",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "required": [
                "code",
                "message"
              ],
              "type": "object",
              "properties": {
                "code": {
                  "enum": [
                    "UNEXPECTED_ERROR",
                    "VALIDATION_ERROR",
                    "NOT_FOUND",
                    "REQUEST_LIMIT_EXCEEDED",
                    "REQUEST_INVALID_CONTENT_TYPE",
                    "UNSUPPORTED_API_VERSION"
                  ],
                  "type": "string",
                  "description": "One of a server-defined set of error codes."
                },
                "message": {
                  "type": "string",
                  "description": "The human-readable representation of the error."
                },
                "target": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "empty-response": {
        "type": "null"
      }
    },
    "examples": {
      "rate-limit-error-response": {
        "value": {
          "errors": [
            {
              "code": "REQUEST_LIMIT_EXCEEDED",
              "message": "API calls quota exceeded! Maximum admitted 1000 per 1m."
            }
          ]
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Attachment",
      "tags": [
        "attachment"
      ]
    }
  ]
}