---
title: "Create a new Attachment"
method: POST
path: "/attachment.json"
tags: ["Attachments"]
---

# Create a new Attachment

`POST /attachment.json`

#### OAuth Scope
This endpoint requires the following OAuth scope **manage_attachments**.

			
			
#### Record UUID
UUID is optional for record creation. If no UUID is supplied, a UUID will be automatically generated for the new record and returned in the `x-record-uuid` response header.

## Request body

- AttachmentCreate
  - `related_object` string — The type of object this attachment is related to (e.g., 'job', 'company', 'staff'). Must be a valid object type. Always stored in lowercase.
  - `related_object_uuid` string, uuid — UUID of the related object to which this attachment belongs. Must be a valid UUID of an existing object of the type specified in the related_object field.
  - `attachment_name` string — The security roles description
  - `file_type` string — Location's name
  - `attachment_source` string — Indicates the source or type of the attachment (e.g., 'INVOICE', 'QUOTE'). Used for filtering and determining how to display the attachment.
  - `tags` string — Comma-separated list of tags associated with the attachment. Used for categorization and filtering of attachments.
  - `lng` number, float — Longitude coordinate where the attachment was created. Used for geolocation of photos and other attachments. Decimal degrees format.
  - `lat` number, float — Latitude coordinate where the attachment was created. Used for geolocation of photos and other attachments. Decimal degrees format.
  - `photo_width` string — Width of the image in pixels. Only applicable for image attachments. Read-only in the API.
  - `photo_height` string — Height of the image in pixels. Only applicable for image attachments. Read-only in the API.
  - `extracted_info` string — Additional information extracted from the file, such as form responses or OCR text. Read-only in the API.
  - `is_favourite` string — Flag indicating whether this attachment has been marked as a favorite. Used for filtering and displaying attachments.
  - `class_name` unknown
  - `metadata` string — Additional structured data associated with the attachment in JSON format. The schema varies depending on attachment type and source. Used to store extended information that doesn't fit into standard fields.
  - `uuid` string, uuid — Unique identifier for this record
  - `created_by_staff_uuid` string, uuid
  - `timestamp` string

## Response `200`

Success

- Result
  - `errorCode` number
  - `message` string

## Other responses

- `400` — Bad Request - The request is malformed or contains invalid parameters
- `401` — Unauthorized - Authentication credentials are missing or invalid
- `403` — Forbidden - You don't have permission to create this resource
- `429` — Too Many Requests - You have exceeded the rate limit
- `500` — Internal Server Error - An unexpected error occurred on the server

---

[API](https://skmtc.net/servicem8/apis/servicem8-api.md) · [All operations](https://skmtc.net/servicem8/apis/servicem8-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/servicem8/servicem8-api/versions/53ede60e3653/schema)
