HydraCore
API by router

Connections

Fetch Connection Credentials

Runtime fetches connection credentials. Auth: Bearer proxy key.

Verifies:

  1. Instance proxy-key auth
  2. Connection grant exists for this instance
  3. If capability specified, grant includes that capability
  4. Decrypts and returns credentials

Returns { "credentials": {...}, "capabilities": [...] }

GET
/internal/v1/instances/{instance_id}/connections

Path Parameters

instance_idInstance Id
Formatuuid

Query Parameters

providerProvider
name?Name
capability?Capability

Required capability (e.g. send_mail). If specified, 403 if grant doesn't include it.

Response Body

curl -X GET "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections?provider=string&name=string&capability=string"
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

List Connections

GET
/v1/customers/{customer_id}/connections
AuthorizationBearer <token>

In: header

Path Parameters

customer_idCustomer Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X GET "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections" \  -H "X-Api-Key: string"
{
  "connections": [
    {
      "auth_type": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
      "error_message": "string",
      "expires_at": "2019-08-24T14:15:22Z",
      "grants": [],
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "last_used_at": "2019-08-24T14:15:22Z",
      "name": "string",
      "provider": "string",
      "scopes": [
        null
      ],
      "status": "string",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Create Connection

POST
/v1/customers/{customer_id}/connections
AuthorizationBearer <token>

In: header

Path Parameters

customer_idCustomer Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key
auth_type?Auth Type

One of: ('oauth2', 'api_key', 'basic')

Default"oauth2"
credentialsCredentials

Provider credentials (stored encrypted)

Empty Object

metadata_json?Metadata Json
nameName

admin@iqm.com.au, IQM Master Roster, etc.

Lengthlength <= 255
providerProvider

gmail, xero, google_calendar, deputy, etc.

Lengthlength <= 50
scopes?Scopes

Response Body

curl -X POST "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{    "credentials": {},    "name": "string",    "provider": "string"  }'
{
  "auth_type": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  "error_message": "string",
  "expires_at": "2019-08-24T14:15:22Z",
  "grants": [],
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "last_used_at": "2019-08-24T14:15:22Z",
  "name": "string",
  "provider": "string",
  "scopes": [
    null
  ],
  "status": "string",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Delete Connection

DELETE
/v1/customers/{customer_id}/connections/{connection_id}
AuthorizationBearer <token>

In: header

Path Parameters

customer_idCustomer Id
Formatuuid
connection_idConnection Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X DELETE "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "X-Api-Key: string"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Create Grant

POST
/v1/customers/{customer_id}/connections/{connection_id}/grants
AuthorizationBearer <token>

In: header

Path Parameters

customer_idCustomer Id
Formatuuid
connection_idConnection Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key
capabilitiesCapabilities

Provider-specific capabilities (e.g. send_mail, read_events)

instance_idInstance Id
Formatuuid

Response Body

curl -X POST "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/grants" \  -H "X-Api-Key: string" \  -H "Content-Type: application/json" \  -d '{    "capabilities": [      "string"    ],    "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366"  }'
{
  "capabilities": [],
  "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
  "granted_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Delete Grant

DELETE
/v1/customers/{customer_id}/connections/{connection_id}/grants/{grant_id}
AuthorizationBearer <token>

In: header

Path Parameters

customer_idCustomer Id
Formatuuid
connection_idConnection Id
Formatuuid
grant_idGrant Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X DELETE "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/grants/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "X-Api-Key: string"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}