Devin

Use cases and templates: Devin integration for AI agents

Use Devin to assign coding tasks and manage their sessions from a workflow. Create Session accepts a prompt, optional playbook, ACU (Autonomous Compute Unit) limit, and tags.

Use Get Session to poll status before consuming pull requests or structured output; session details also report resource use. List Sessions supports pagination. Send Message supplies context or redirects an active session and resumes suspended sessions automatically. Set an ACU limit when you need a spending boundary.

Use the block

Create coding sessions, list or inspect their status and results, and send messages to guide active or suspended work. Use playbooks and ACU limits for repeatable tasks and spending control.

Actions

Devin Create Session

Create a new Devin session with a prompt. Devin will autonomously work on the task described in the prompt.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
promptstringYesThe task prompt for Devin to work on
playbookIdstringNoOptional playbook ID to guide the session
maxAcuLimitnumberNoMaximum ACU limit for the session
tagsstringNoComma-separated tags for the session

Output

ParameterTypeDescription
sessionIdstringUnique identifier for the session
urlstringURL to view the session in the Devin UI
statusstringSession status (new, claimed, running, exit, error, suspended, resuming)
statusDetailstringDetailed status (working, waiting_for_user, waiting_for_approval, finished, inactivity, etc.)
titlestringSession title
createdAtnumberUnix timestamp when the session was created
updatedAtnumberUnix timestamp when the session was last updated
acusConsumednumberACUs consumed by the session
tagsjsonTags associated with the session (array of strings)
pullRequestsjsonPull requests created during the session ([{pr_url, pr_state}])
structuredOutputjsonStructured output from the session
playbookIdstringAssociated playbook ID
isArchivedbooleanWhether the session is archived

Devin Get Session

Retrieve details of an existing Devin session including status, tags, pull requests, and structured output.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to retrieve

Output

ParameterTypeDescription
sessionIdstringUnique identifier for the session
urlstringURL to view the session in the Devin UI
statusstringSession status (new, claimed, running, exit, error, suspended, resuming)
statusDetailstringDetailed status (working, waiting_for_user, waiting_for_approval, finished, inactivity, etc.)
titlestringSession title
createdAtnumberUnix timestamp when the session was created
updatedAtnumberUnix timestamp when the session was last updated
acusConsumednumberACUs consumed by the session
tagsjsonTags associated with the session (array of strings)
pullRequestsjsonPull requests created during the session ([{pr_url, pr_state}])
structuredOutputjsonStructured output from the session
playbookIdstringAssociated playbook ID
isArchivedbooleanWhether the session is archived

Devin List Sessions

List Devin sessions in the organization. Returns up to 100 sessions by default.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
limitnumberNoMaximum number of sessions to return (1-200, default: 100)
afterstringNoPagination cursor (endCursor from a previous response) to fetch the next page

Output

ParameterTypeDescription
sessionsarrayList of Devin sessions
↳ sessionIdstringUnique identifier for the session
↳ urlstringURL to view the session
↳ statusstringSession status
↳ statusDetailstringDetailed status
↳ titlestringSession title
↳ createdAtnumberCreation timestamp (Unix)
↳ updatedAtnumberLast updated timestamp (Unix)
↳ tagsjsonSession tags (array of strings)
↳ acusConsumednumberACUs consumed by the session
↳ pullRequestsjsonPull requests created during the session ([{pr_url, pr_state}])
↳ playbookIdstringAssociated playbook ID
↳ isArchivedbooleanWhether the session is archived
endCursorstringPagination cursor for the next page, or null if last page
hasNextPagebooleanWhether more sessions are available
totalnumberTotal number of sessions, if provided

Devin Send Message

Send a message to a Devin session. If the session is suspended, it will be automatically resumed. Returns the updated session state.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to send the message to
messagestringYesThe message to send to Devin

Output

ParameterTypeDescription
sessionIdstringUnique identifier for the session
urlstringURL to view the session in the Devin UI
statusstringSession status (new, claimed, running, exit, error, suspended, resuming)
statusDetailstringDetailed status (working, waiting_for_user, waiting_for_approval, finished, inactivity, etc.)
titlestringSession title
createdAtnumberUnix timestamp when the session was created
updatedAtnumberUnix timestamp when the session was last updated
acusConsumednumberACUs consumed by the session
tagsjsonTags associated with the session (array of strings)
pullRequestsjsonPull requests created during the session ([{pr_url, pr_state}])
structuredOutputjsonStructured output from the session
playbookIdstringAssociated playbook ID
isArchivedbooleanWhether the session is archived

Devin List Session Messages

List the messages exchanged in a Devin session, including messages from both the user and Devin.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to list messages for
limitnumberNoMaximum number of messages to return (1-200, default: 100)
afterstringNoPagination cursor (endCursor from a previous response) to fetch the next page

Output

ParameterTypeDescription
messagesarrayMessages exchanged in the session
↳ eventIdstringUnique identifier for the message event
↳ sourcestringOrigin of the message (devin or user)
↳ messagestringThe message content
↳ createdAtnumberUnix timestamp when the message was created
endCursorstringPagination cursor for the next page, or null if last page
hasNextPagebooleanWhether more messages are available
totalnumberTotal number of messages, if provided

Devin List Session Attachments

List the files uploaded to or produced by a Devin session.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to list attachments for

Output

ParameterTypeDescription
attachmentsarrayAttachments associated with the session
↳ attachmentIdstringUnique identifier for the attachment
↳ namestringAttachment file name
↳ urlstringURL to download the attachment
↳ sourcestringOrigin of the attachment (devin or user)
↳ contentTypestringMIME type of the attachment

Devin Get Session Tags

Retrieve the tags currently applied to a Devin session.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to retrieve tags for

Output

ParameterTypeDescription
tagsjsonTags applied to the session (array of strings)

Devin Append Session Tags

Add tags to a Devin session without removing existing tags (max 50 tags total).

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to add tags to
tagsstringYesTags to append to the session (comma-separated string or array of strings)

Output

ParameterTypeDescription
tagsjsonUpdated list of tags on the session (array of strings)

Devin Replace Session Tags

Replace all tags on a Devin session with a new set of tags (max 50 tags).

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to replace tags on
tagsstringYesTags that will overwrite the existing tags (comma-separated string or array of strings)

Output

ParameterTypeDescription
tagsjsonUpdated list of tags on the session (array of strings)

Devin Archive Session

Archive a Devin session. Archived sessions can still be viewed but cannot be modified or resumed.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to archive

Output

ParameterTypeDescription
sessionIdstringUnique identifier for the session
urlstringURL to view the session in the Devin UI
statusstringSession status (new, claimed, running, exit, error, suspended, resuming)
statusDetailstringDetailed status (working, waiting_for_user, waiting_for_approval, finished, inactivity, etc.)
titlestringSession title
createdAtnumberUnix timestamp when the session was created
updatedAtnumberUnix timestamp when the session was last updated
acusConsumednumberACUs consumed by the session
tagsjsonTags associated with the session (array of strings)
pullRequestsjsonPull requests created during the session ([{pr_url, pr_state}])
structuredOutputjsonStructured output from the session
playbookIdstringAssociated playbook ID
isArchivedbooleanWhether the session is archived

Devin Terminate Session

Terminate a Devin session. Optionally archive the session instead of permanently terminating it.

Input

ParameterTypeRequiredDescription
apiKeystringYesDevin API key (service user credential starting with cog_)
orgIdstringYesDevin organization ID (prefixed with org-)
sessionIdstringYesThe session ID to terminate
archivebooleanNoArchive the session instead of permanently terminating it (default: false)

Output

ParameterTypeDescription
sessionIdstringUnique identifier for the session
urlstringURL to view the session in the Devin UI
statusstringSession status (new, claimed, running, exit, error, suspended, resuming)
statusDetailstringDetailed status (working, waiting_for_user, waiting_for_approval, finished, inactivity, etc.)
titlestringSession title
createdAtnumberUnix timestamp when the session was created
updatedAtnumberUnix timestamp when the session was last updated
acusConsumednumberACUs consumed by the session
tagsjsonTags associated with the session (array of strings)
pullRequestsjsonPull requests created during the session ([{pr_url, pr_state}])
structuredOutputjsonStructured output from the session
playbookIdstringAssociated playbook ID
isArchivedbooleanWhether the session is archived