POST Access check: require_login
POST /attachments - upload a single file as a temporary attachment.
Handler: cb_upload()
Parameters of POST /attachments Parameter Type Required Default or allowed values target_type string Yes — target_id integer No 0
curl Copycurl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments" \
-H "Content-Type: application/json" \
-d '{"target_type": "…"}' GET Public
GET /attachments?target_type=&target_id= - list committed attachments for a target.
Handler: cb_list_for_target()
Parameters of GET /attachments Parameter Type Required Default or allowed values target_type string Yes — target_id integer Yes —
curl Copycurl "https://example.com/wp-json/davo/v1/attachments?target_type=…&target_id=1" src/domains/attachments/routes.php:286
DELETE Access check: require_login
DELETE /attachments/{id} - remove a temporary or committed attachment.
Handler: cb_remove()
Parameters of DELETE /attachments/{id} Parameter Type Required Default or allowed values id integer Yes —
curl Copycurl -X DELETE -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/{id}" src/domains/attachments/routes.php:355
GET Public
GET /attachments/{id}/download - stream a committed attachment's file after re-validating access, rather than exposing a bare public URL.
Handler: cb_download()
Parameters of GET /attachments/{id}/download Parameter Type Required Default or allowed values id integer Yes —
curl Copycurl "https://example.com/wp-json/davo/v1/attachments/{id}/download" src/domains/attachments/routes.php:372
GET Public
GET /attachments/{id}/preview?expires=&size=&sig= - stream an attachment inline for display (image url/thumbnail_url in Attachments_Helpers::build_response()), gated first by the signed, expiring link parameters and then by the same live permission check cb_download() uses. Replaces exposing a bare, permanent wp_get_attachment_url() link for attachment previews.
Handler: cb_preview()
Parameters of GET /attachments/{id}/preview Parameter Type Required Default or allowed values id integer Yes — expires integer Yes — size string Yes full | thumbnail sig string Yes —
curl Copycurl "https://example.com/wp-json/davo/v1/attachments/{id}/preview?expires=1&size=full&sig=…" src/domains/attachments/routes.php:389
POST Access check: require_login
Called explicitly by the consuming domain's frontend right after its own create/update request succeeds - see Questions_Attachments_Integration's class docblock for why this is a separate, explicit call rather than something inferred from a Questions lifecycle hook.
Handler: cb_commit()
Parameters of POST /attachments/commit Parameter Type Required Default or allowed values attachment_ids array Yes — target_type string Yes — target_id integer Yes —
curl Copycurl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/commit" \
-H "Content-Type: application/json" \
-d '{"attachment_ids": [], "target_type": "…", "target_id": 1}' src/domains/attachments/routes.php:328
POST Access check: require_storage_admin
POST /attachments/storage/migrate-local - move a batch of local-only files.
Handler: cb_storage_migrate_local()
Parameters of POST /attachments/storage/migrate-local Parameter Type Required Default or allowed values batch integer — 5
curl Copycurl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/storage/migrate-local" src/domains/attachments/routes.php:146
POST Access check: require_storage_admin
POST /attachments/storage/oauth/disconnect - forget the authorization.
Handler: cb_storage_oauth_disconnect()
Parameters of POST /attachments/storage/oauth/disconnect Parameter Type Required Default or allowed values provider string Yes —
curl Copycurl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/storage/oauth/disconnect" \
-H "Content-Type: application/json" \
-d '{"provider": "…"}' src/domains/attachments/routes.php:129
POST Access check: require_storage_admin
POST /attachments/storage/oauth/start - returns the provider consent URL.
Handler: cb_storage_oauth_start()
Parameters of POST /attachments/storage/oauth/start Parameter Type Required Default or allowed values provider string Yes — return_url string Yes —
curl Copycurl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/storage/oauth/start" \
-H "Content-Type: application/json" \
-d '{"provider": "…", "return_url": "…"}' src/domains/attachments/routes.php:107
POST Access check: require_storage_admin
POST /attachments/storage/retry-failed - re-queue failed pushes.
Handler: cb_storage_retry_failed()
No parameters declared in the route registration.
curl Copycurl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/storage/retry-failed" src/domains/attachments/routes.php:164
PUT PATCH Access check: require_storage_admin
PUT /attachments/storage/secret - write-only; the secret is never returned by any endpoint. An empty value clears it.
Handler: cb_storage_secret()
Parameters of PUT/PATCH /attachments/storage/secret Parameter Type Required Default or allowed values secret string Yes — provider string — s3
curl Copycurl -X PUT -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/storage/secret" \
-H "Content-Type: application/json" \
-d '{"secret": "…"}' src/domains/attachments/routes.php:86
GET Access check: require_storage_admin
GET /attachments/storage/status - counts per storage state.
Handler: cb_storage_status()
No parameters declared in the route registration.
curl Copycurl -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/storage/status" src/domains/attachments/routes.php:59
POST Access check: require_storage_admin
POST /attachments/storage/test - round-trip check of a driver.
Handler: cb_storage_test()
Parameters of POST /attachments/storage/test Parameter Type Required Default or allowed values driver string Yes —
curl Copycurl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/attachments/storage/test" \
-H "Content-Type: application/json" \
-d '{"driver": "…"}' src/domains/attachments/routes.php:69