Get It Done Logo
Get It Done

Register an uploaded attachment

POST/v1/tasks/{task_id}/attachments

Phase 2 of the two-phase upload: attaches the uploaded file (by its `file_key`) to the task's CURRENT version — exactly how the in-app flow registers uploads after the presigned PUT. Supports the optional `Idempotency-Key` header for exactly-once retries.

Required scopes
tasks:write
Availability
All plans
Quota cost
1 API call
Idempotency
Optional Idempotency-Key

Request

Path parameters

FieldTypeDescription
task_idrequiredstringTask short id, e.g. `T-123` (a bare `123` is also accepted on input).e.g. T-123

Request body

FieldTypeDescription
file_namerequiredstring
file_keyrequiredstringThe `file_key` returned by the upload endpoint.
content_typerequiredstring
sizerequiredintegerFile size in bytes as uploaded.
Raw request schema
{
  "type": "object",
  "properties": {
    "file_name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "file_key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024,
      "description": "The `file_key` returned by the upload endpoint."
    },
    "content_type": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991,
      "description": "File size in bytes as uploaded."
    }
  },
  "required": [
    "file_name",
    "file_key",
    "content_type",
    "size"
  ],
  "description": "Phase 2 of the two-phase upload: register the uploaded file on the task."
}

Response 201

The registered attachment.

Fields

FieldTypeDescription
idrequiredstringStable opaque attachment id.
file_namerequiredstringe.g. screenshot.png
content_typerequiredstringe.g. image/png
sizerequiredintegerFile size in bytes.
created_atrequiredstring (date-time)
Raw response schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable opaque attachment id."
    },
    "file_name": {
      "type": "string",
      "example": "screenshot.png"
    },
    "content_type": {
      "type": "string",
      "example": "image/png"
    },
    "size": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "File size in bytes."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    }
  },
  "required": [
    "id",
    "file_name",
    "content_type",
    "size",
    "created_at"
  ],
  "additionalProperties": false,
  "description": "A file attached to a task's current version. Fetch its bytes via the `download-url` endpoint."
}

Example request

curl
curl -X POST https://app.nowgetitdone.com/v1/tasks/T-123/attachments \
  -H "Authorization: Bearer gid_YOUR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "file_name": "string",
    "file_key": "string",
    "content_type": "string",
    "size": 1
  }'

Possible errors