Proxy Hooks
Manage MITM hook scripts that intercept container traffic before it reaches the real upstream service. Hooks are stored per-service, evaluated in declared order (first-match-wins), and every write is ETag-gated with If-Match: file:v. The service names logs, proxy, workspaces, and cdp are reject-listed and cannot be targeted.
GET /api/v1/containers/{id}/proxy/hooks
Returns every hook grouped by service, together with the current file_version and ETag.
Name In Type Required Description idpath string Yes Container ID
" message " : " Proxy hooks listed successfully " ,
" id " : " 01hz3x5k2n4q8w7vrgc6t1m4bz " ,
" path " : " /workspace/hooks/login-trace.js "
" groups " : [ " qa " , " preview " ]
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . listContainerProxyHooks ( id )
curl -X GET " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks " \
-H " Authorization: Bearer <token> "
GET /api/v1/containers/{id}/proxy/hooks/{service}
Returns the ordered hook array for a single service. First-match-wins within this array.
Name In Type Required Description idpath string Yes Container ID servicepath string Yes Service name
" message " : " Service hooks listed successfully " ,
" id " : " 01hz3x5k2n4q8w7vrgc6t1m4bz " ,
" path " : " /workspace/hooks/login-trace.js "
" groups " : [ " qa " , " preview " ]
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . listContainerProxyServiceHooks ( id , service )
curl -X GET " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks/api " \
-H " Authorization: Bearer <token> "
GET /api/v1/containers/{id}/proxy/hooks/{service}/{hookId}
Returns one hook by id, including the current file version and ETag.
Name In Type Required Description idpath string Yes Container ID servicepath string Yes Service name hookIdpath string Yes 26-char Crockford base32 ULID (lowercase)
" message " : " Hook retrieved successfully " ,
" id " : " 01hz3x5k2n4q8w7vrgc6t1m4bz " ,
" path " : " /workspace/hooks/login-trace.js "
" groups " : [ " qa " , " preview " ]
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . getContainerProxyHook ( id , service , hookId )
curl -X GET " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks/api/01hz3x5k2n4q8w7vrgc6t1m4bz " \
-H " Authorization: Bearer <token> "
POST /api/v1/containers/{id}/proxy/hooks/{service}
Append a new hook to a service, or insert at a specific position. Omit position to append to the end of the array. Requires If-Match.
Name In Type Required Description idpath string Yes Container ID servicepath string Yes Service name if-matchheader string No file:v ETag precondition
Field Type Required Description matchobject Yes Request matcher — see fields below scriptobject Yes Script reference — path is required timeoutinteger No Execution timeout in milliseconds (1 to 30000) applies_toobject No Targeting — groups array of group names positioninteger No Zero-indexed insertion position
match fields:
Field Type Required Description methodstring or array of strings No A single HTTP method (*, GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) or an array of methods pathstring No URL path matcher, up to 257 characters headersobject No Map of header name to expected value
script fields:
Field Type Required Description pathstring Yes Filesystem path to the hook script subdomainstring No Optional subdomain binding execIdstring No Optional pre-existing execution id
" path " : " /workspace/hooks/user-trace.js "
" message " : " Hook created successfully " ,
" id " : " 01hz3x5k2n4q8w7vrgc6t1m4bz " ,
" path " : " /workspace/hooks/user-trace.js "
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Failed " ,
" message " : " etag_mismatch "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Validation Error " ,
" message " : " Invalid hook "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Required " ,
" message " : " If-Match header required for this operation "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . addContainerProxyHook (
match : { method : " GET " , path : " /v1/users/* " , headers : { " x-trace " : " 1 " } },
script : { path : " /workspace/hooks/user-trace.js " },
applies_to : { groups : [ " qa " ] }
curl -X POST " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks/api " \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-H " If-Match: file:v42 " \
"headers": { "x-trace": "1" }
"script": { "path": "/workspace/hooks/user-trace.js" },
"applies_to": { "groups": ["qa"] }
PUT /api/v1/containers/{id}/proxy/hooks/{service}/{hookId}
Full-replace a hook preserving its id and position. Requires If-Match.
Name In Type Required Description idpath string Yes Container ID servicepath string Yes Service name hookIdpath string Yes 26-char Crockford base32 ULID (lowercase) if-matchheader string No file:v ETag precondition
Field Type Required Description matchobject Yes Request matcher — see fields below scriptobject Yes Script reference — path is required timeoutinteger No Execution timeout in milliseconds (1 to 30000) applies_toobject No Targeting — groups array of group names positioninteger No Zero-indexed insertion position (POST only)
match fields:
Field Type Required Description methodstring or array of strings No A single HTTP method (*, GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) or an array of methods pathstring No URL path matcher, up to 257 characters headersobject No Map of header name to expected value
script fields:
Field Type Required Description pathstring Yes Filesystem path to the hook script subdomainstring No Optional subdomain binding execIdstring No Optional pre-existing execution id
" path " : " /workspace/hooks/user-trace.js "
" message " : " Hook updated successfully " ,
" id " : " 01hz3x5k2n4q8w7vrgc6t1m4bz " ,
" path " : " /workspace/hooks/user-trace.js "
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Failed " ,
" message " : " etag_mismatch "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Validation Error " ,
" message " : " Invalid hook "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Required " ,
" message " : " If-Match header required for this operation "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . updateContainerProxyHook (
match : { method : " GET " , path : " /v1/users/* " , headers : { " x-trace " : " 1 " } },
script : { path : " /workspace/hooks/user-trace.js " },
applies_to : { groups : [ " qa " ] }
curl -X PUT " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks/api/01hz3x5k2n4q8w7vrgc6t1m4bz " \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-H " If-Match: file:v43 " \
"headers": { "x-trace": "1" }
"script": { "path": "/workspace/hooks/user-trace.js" },
"applies_to": { "groups": ["qa"] }
PATCH /api/v1/containers/{id}/proxy/hooks/{service}/{hookId}/position
Atomic reposition within the service array. Requires If-Match.
Name In Type Required Description idpath string Yes Container ID servicepath string Yes Service name hookIdpath string Yes 26-char Crockford base32 ULID (lowercase) if-matchheader string No file:v ETag precondition
Field Type Required Description positioninteger Yes Zero-indexed destination position within the service array
" message " : " Hook moved successfully " ,
" id " : " 01hz3x5k2n4q8w7vrgc6t1m4bz " ,
" path " : " /workspace/hooks/login-trace.js "
" groups " : [ " qa " , " preview " ]
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Failed " ,
" message " : " etag_mismatch "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Required " ,
" message " : " If-Match header required for this operation "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . moveContainerProxyHook (
curl -X PATCH " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks/api/01hz3x5k2n4q8w7vrgc6t1m4bz/position " \
-H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-H " If-Match: file:v44 " \
DELETE /api/v1/containers/{id}/proxy/hooks/{service}
Remove every hook under the named service. Requires If-Match.
Name In Type Required Description idpath string Yes Container ID servicepath string Yes Service name if-matchheader string No file:v ETag precondition
" message " : " Service hooks cleared successfully " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Failed " ,
" message " : " etag_mismatch "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Required " ,
" message " : " If-Match header required for this operation "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . clearContainerProxyServiceHooks ( id , service , { ifMatch : " file:v45 " })
curl -X DELETE " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks/api " \
-H " Authorization: Bearer <token> " \
DELETE /api/v1/containers/{id}/proxy/hooks/{service}/{hookId}
Delete a single hook. Requires If-Match.
Name In Type Required Description idpath string Yes Container ID servicepath string Yes Service name hookIdpath string Yes 26-char Crockford base32 ULID (lowercase) if-matchheader string No file:v ETag precondition
" message " : " Hook removed successfully " ,
" message " : " Resource not found "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Failed " ,
" message " : " etag_mismatch "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
" error " : " Precondition Required " ,
" message " : " If-Match header required for this operation "
Error Code Title Description Resolution NOT_FOUNDHook or service not found The hook id, service, or container does not exist, or the service is reject-listed Verify the service name is not reject-listed (logs, proxy, workspaces, cdp) and that the hook id exists VALIDATION_ERRORValidation error Request body violates hook schema, caps, or referential integrity Check error details and correct the body shape; ensure applies_to.groups references defined groups PRECONDITION_REQUIREDIf-Match required Destructive writes require an If-Match: file:v header Fetch the resource first to obtain the ETag and resend with If-Match PRECONDITION_FAILEDETag mismatch The If-Match header does not match the current file_version Re-fetch the resource to get the current ETag and retry
await client . api . proxyHooks . removeContainerProxyHook ( id , service , hookId , { ifMatch : " file:v46 " })
curl -X DELETE " https://api.hoody.icu/api/v1/containers/cnt_abc123/proxy/hooks/api/01hz3x5k2n4q8w7vrgc6t1m4bz " \
-H " Authorization: Bearer <token> " \