Add method
truto integrations add-method adds one method to an existing integration. Give it the HTTP verb and path (or paste a curl example); the CLI merges them into config.resources and PATCHes the integration. No LLM calls, no doc crawl.
Building a whole integration from docs instead? Use AI-powered build.
Quick start
# 1. Preview the merged config first (reads the integration, writes nothing)
truto integrations add-method hubspot contacts archive \
--http-method POST \
--path /crm/v3/objects/contacts/{{query.contact_id}}/archive \
--print
# 2. Looks right? Drop --print to PATCH it for real
truto integrations add-method hubspot contacts archive \
--http-method POST \
--path /crm/v3/objects/contacts/{{query.contact_id}}/archivePrefer a file to eyeball? Use --out patched.json instead of --print.
Build the command
truto integrations add-method <slug-or-id> <resource> <method-name> \
--http-method <verb> \
--path <path-template>slug-or-id: the integration's slug (e.g.hubspot) or UUID.resource: e.g.contacts. Created empty if missing, unless--no-create-resource.method-name: e.g.list,get,archive. Won't overwrite an existing method unless--force.--path: use{{id}}forget/update/delete. Other methods take the id as{{query.<name>}}.
From curl
Paste a curl command and skip the flags. The CLI pulls the verb, path, and body out of it.
truto integrations add-method acme-crm contacts create \
--from-curl 'curl -X POST "https://api.acme.test/v1/contacts" \
-H "Authorization: Bearer $TOKEN" \
-d "{\"name\":\"jane\"}"' \
--print-X/--requestsets the verb. Otherwise data (-d,--data*,--json) makes it POST,-Tmakes it PUT, and no data makes it GET.-F name=@filebecomes a multipart upload;-T fileor--data-binary @filebecomes a raw one.- Other headers are ignored. Auth lives on the integration, not per method.
- A flag you also pass overrides what curl gave. Use
--pathto swap a sample id from the docs for{{query.<name>}}.
A path placeholder written as {id}, :id or <id> is refused. Use {{id}} or {{query.<name>}} instead.
A sample record id from the docs, such as /contacts/12345, only gets a warning. Swap it out with --path.
Flags
| Flag | What it does |
|---|---|
--http-method |
GET, POST, PATCH, PUT, DELETE, … |
--path |
Upstream path template |
--from-curl |
Parse verb, path, and body from pasted curl text |
--response-path |
JSONata path to unwrap list/object responses (e.g. results) |
--pagination |
cursor, offset, page, or none |
--body / --body-file / --body-format |
Default request body for the method |
--force |
Replace an existing method with the same name |
--no-create-resource |
Fail if the resource doesn't exist |
--print |
Print the merged config instead of PATCHing |
--out |
Save the merged config to a file instead of PATCHing |
See every flag: truto integrations add-method --help
Exit codes
After the PATCH, the command re-reads the integration to confirm the write landed.
| Exit | Meaning |
|---|---|
| 0 | Written. |
| 1 | Authentication or unexpected failure. |
| 2 | Written, but not live as sent, or the re-read itself failed. |
| 3 | Not written: held, stale version, rejected, or no effect. Check truto integrations get <id> before retrying. |
--print and --out leave out plaintext credential secrets. To reuse a saved file with truto integrations update --body-file, put every left-out secret back. That command refuses a config still missing one.
What else it checks
- Runs the same audit as
apply. Only a new ERROR, or one on the method you touched, blocks the write. Pass--allow-audit-errorsto push anyway. - Refuses a write that would lose a stored credential secret, the same way
truto integrations updatedoes. - Writes no documentation for the method: no description, no query or response schemas. The exception is a file field from
--from-curl, which gets marked binary. For full docs, use AI-powered build.
Next
- Managing integrations: list, get, and update integrations.
- AI-powered build: build a full integration from docs.