REST API

Connections

Derived from the source of github.com/awee-ai/api/cmd/connections.

Awee Connections API · v1.0.0 · 6 endpoints

Connections

GET/v1/connectionsAuth

Returns the caller's connections, metadata only

conns.Handler.List

Takes no parameters and no request body.

Responses

200 OKOK
accountstringrequired

Is the external account the grant belongs to, e.g.

capabilitiesstring[]

Lists what the grant allows, e.g.

idstringrequired

Names the connection in workflows and awee connect commands.

methodstringrequired

Is how the grant was established, one of the Method* constants.

providerstringrequired

Is the service family: "google", "microsoft", "imap", "smtp", "oauth2", "apikey".

settingsobject

Holds non-secret provider settings such as IMAP/SMTP hosts.

*stringany additional property
401 Unauthorizedthe request could not be completed
errorstringrequired
404 Not Foundthe request could not be completed
errorstringrequired
500 Internal Server Errorthe request could not be completed
errorstringrequired
Defaultthe request could not be completed
errorstringrequired
Request

No request body.

200 OK
[
  {
    "account": "string",
    "capabilities": [
      "string"
    ],
    "id": "string",
    "method": "string",
    "provider": "string",
    "settings": {
      "key": "string"
    }
  }
]
PUT/v1/connections/{id}Auth

Upserts a connection with a credential pushed from a local store during pipe auth sync

The path id wins over the body's connection id.

conns.Handler.Put

Path parameters

idstringrequired

Body

application/jsonrequired
connectionConnectionrequired

Is the non-secret description of one grant against an external service.

accountstringrequired

Is the external account the grant belongs to, e.g.

capabilitiesstring[]

Lists what the grant allows, e.g.

idstringrequired

Names the connection in workflows and awee connect commands.

methodstringrequired

Is how the grant was established, one of the Method* constants.

providerstringrequired

Is the service family: "google", "microsoft", "imap", "smtp", "oauth2", "apikey".

settingsobject

Holds non-secret provider settings such as IMAP/SMTP hosts.

*stringany additional property
credentialCredentialrequired

Is the secret material behind a connection.

access_tokenstring
api_keystring
client_idstring
client_secretstring
expirystring (date-time)
kindstringrequired
passwordstring
refresh_tokenstring
scopesstring[]
token_urlstring
usernamestring

Responses

200 OKOK
accountstringrequired

Is the external account the grant belongs to, e.g.

capabilitiesstring[]

Lists what the grant allows, e.g.

idstringrequired

Names the connection in workflows and awee connect commands.

methodstringrequired

Is how the grant was established, one of the Method* constants.

providerstringrequired

Is the service family: "google", "microsoft", "imap", "smtp", "oauth2", "apikey".

settingsobject

Holds non-secret provider settings such as IMAP/SMTP hosts.

*stringany additional property
400 Bad Requestthe request could not be completed
errorstringrequired
401 Unauthorizedthe request could not be completed
errorstringrequired
404 Not Foundthe request could not be completed
errorstringrequired
500 Internal Server Errorthe request could not be completed
errorstringrequired
Defaultthe request could not be completed
errorstringrequired
Request body
{
  "connection": {
    "account": "string",
    "capabilities": [
      "string"
    ],
    "id": "string",
    "method": "string",
    "provider": "string",
    "settings": {
      "key": "string"
    }
  },
  "credential": {
    "access_token": "string",
    "api_key": "string",
    "client_id": "string",
    "client_secret": "string",
    "expiry": "2024-01-15T09:30:00Z",
    "kind": "string",
    "password": "string",
    "refresh_token": "string",
    "scopes": [
      "string"
    ],
    "token_url": "string",
    "username": "string"
  }
}
200 OK
{
  "account": "string",
  "capabilities": [
    "string"
  ],
  "id": "string",
  "method": "string",
  "provider": "string",
  "settings": {
    "key": "string"
  }
}
DELETE/v1/connections/{id}Auth

Removes the caller's connection and its credential

conns.Handler.Delete

Path parameters

idstringrequired

Responses

204 No ContentNo Content

No response body.

401 Unauthorizedthe request could not be completed
errorstringrequired
404 Not Foundthe request could not be completed
errorstringrequired
500 Internal Server Errorthe request could not be completed
errorstringrequired
Defaultthe request could not be completed
errorstringrequired
Request

No request body.

401 Unauthorized
{
  "error": "string"
}
GET/v1/connections/{id}/credentialAuth

Returns the live credential for the caller's connection, refreshed first when the stored access token has expired

The pipeline chain store calls this during pipe auth sync.

conns.Handler.GetCredential

Path parameters

idstringrequired

Responses

200 OKOK
connectionConnectionrequired

Is the non-secret description of one grant against an external service.

accountstringrequired

Is the external account the grant belongs to, e.g.

capabilitiesstring[]

Lists what the grant allows, e.g.

idstringrequired

Names the connection in workflows and awee connect commands.

methodstringrequired

Is how the grant was established, one of the Method* constants.

providerstringrequired

Is the service family: "google", "microsoft", "imap", "smtp", "oauth2", "apikey".

settingsobject

Holds non-secret provider settings such as IMAP/SMTP hosts.

*stringany additional property
credentialCredentialrequired

Is the secret material behind a connection.

access_tokenstring
api_keystring
client_idstring
client_secretstring
expirystring (date-time)
kindstringrequired
passwordstring
refresh_tokenstring
scopesstring[]
token_urlstring
usernamestring
401 Unauthorizedthe request could not be completed
errorstringrequired
404 Not Foundthe request could not be completed
errorstringrequired
500 Internal Server Errorthe request could not be completed
errorstringrequired
Defaultthe request could not be completed
errorstringrequired
Request

No request body.

200 OK
{
  "connection": {
    "account": "string",
    "capabilities": [
      "string"
    ],
    "id": "string",
    "method": "string",
    "provider": "string",
    "settings": {
      "key": "string"
    }
  },
  "credential": {
    "access_token": "string",
    "api_key": "string",
    "client_id": "string",
    "client_secret": "string",
    "expiry": "2024-01-15T09:30:00Z",
    "kind": "string",
    "password": "string",
    "refresh_token": "string",
    "scopes": [
      "string"
    ],
    "token_url": "string",
    "username": "string"
  }
}
POST/v1/connections/{provider}/startAuth

Begins an OAuth flow for the provider in the path and returns the authorize URL the SPA redirects the user to

conns.Handler.Start

Path parameters

providerstringrequired

Body

application/jsonrequired
accountstringrequired
auth_urlstring
client_idstring
client_secretstring
connection_idstringrequired
methodstringrequired
scopesstring[]
token_urlstring

Responses

200 OKOK
authorize_urlstringrequired
400 Bad Requestthe request could not be completed
errorstringrequired
401 Unauthorizedthe request could not be completed
errorstringrequired
404 Not Foundthe request could not be completed
errorstringrequired
500 Internal Server Errorthe request could not be completed
errorstringrequired
Defaultthe request could not be completed
errorstringrequired
Request body
{
  "account": "string",
  "auth_url": "string",
  "client_id": "string",
  "client_secret": "string",
  "connection_id": "string",
  "method": "string",
  "scopes": [
    "string"
  ],
  "token_url": "string"
}
200 OK
{
  "authorize_url": "string"
}
GET/v1/connections/callbackPublic

Is the provider redirect target

It completes the pending flow the state parameter names and persists the resulting credential under the flow's owner, then renders a plain close-this-tab page.

conns.Handler.Callback

Query parameters

errorstring
error_descriptionstring
statestring
codestring

Responses

200 OKOK
string
400 Bad RequestBad Request
string
500 Internal Server ErrorInternal Server Error
string
Request

No request body.

200 OK
"string"