AlphaAlpha Docs

A P I key

Operations related to API keys

Create API key

POST
/api-key
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:18080/api/v1/api-key" \  -H "Content-Type: application/json" \  -d '{    "daysTillExpiration": 0,    "permissions": {      "appPermissions": [        "CREATE_APIKEYS"      ],      "assetManagementPermissions": [        "CREATE_ASSETS"      ],      "calendarPermissions": [        "CREATE_CALENDAR_EVENTS"      ],      "communicationsPermissions": [        "CREATE_TEMPLATES"      ],      "configuratorPermissions": [        "CREATE_CONCEPTS"      ],      "crmPermissions": [        "CREATE_LEADS"      ],      "financePermissions": [        "CREATE_CLIENTS"      ],      "hrPermissions": [        "CREATE_EMPLOYEES"      ],      "inventoryPermissions": [        "CREATE_INVENTORY"      ],      "productionPermissions": [        "CREATE_PRODUCTION"      ],      "productsPermissions": [        "CREATE_PRODUCTS"      ],      "projectsPermissions": [        "CREATE_PROJECTS"      ],      "reportingPermissions": [        "READ_SALES_REPORTS"      ]    }  }'
{
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "expiration": "2019-08-24T14:15:22Z",
  "key": "string",
  "name": "string",
  "permissions": {
    "appPermissions": [
      "CREATE_APIKEYS"
    ],
    "assetManagementPermissions": [
      "CREATE_ASSETS"
    ],
    "calendarPermissions": [
      "CREATE_CALENDAR_EVENTS"
    ],
    "communicationsPermissions": [
      "CREATE_TEMPLATES"
    ],
    "configuratorPermissions": [
      "CREATE_CONCEPTS"
    ],
    "crmPermissions": [
      "CREATE_LEADS"
    ],
    "financePermissions": [
      "CREATE_CLIENTS"
    ],
    "hrPermissions": [
      "CREATE_EMPLOYEES"
    ],
    "inventoryPermissions": [
      "CREATE_INVENTORY"
    ],
    "productionPermissions": [
      "CREATE_PRODUCTION"
    ],
    "productsPermissions": [
      "CREATE_PRODUCTS"
    ],
    "projectsPermissions": [
      "CREATE_PROJECTS"
    ],
    "reportingPermissions": [
      "READ_SALES_REPORTS"
    ]
  },
  "tenantId": "string",
  "truncatedKey": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Retrieve all API keys for the currently authenticated user

GET
/api-key/all
AuthorizationBearer <token>

In: header

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/api-key/all"
[
  {
    "created": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "expiration": "2019-08-24T14:15:22Z",
    "id": "string",
    "lastUsed": "2019-08-24T14:15:22Z",
    "name": "string",
    "permissions": {
      "appPermissions": [
        "CREATE_APIKEYS"
      ],
      "assetManagementPermissions": [
        "CREATE_ASSETS"
      ],
      "calendarPermissions": [
        "CREATE_CALENDAR_EVENTS"
      ],
      "communicationsPermissions": [
        "CREATE_TEMPLATES"
      ],
      "configuratorPermissions": [
        "CREATE_CONCEPTS"
      ],
      "crmPermissions": [
        "CREATE_LEADS"
      ],
      "financePermissions": [
        "CREATE_CLIENTS"
      ],
      "hrPermissions": [
        "CREATE_EMPLOYEES"
      ],
      "inventoryPermissions": [
        "CREATE_INVENTORY"
      ],
      "productionPermissions": [
        "CREATE_PRODUCTION"
      ],
      "productsPermissions": [
        "CREATE_PRODUCTS"
      ],
      "projectsPermissions": [
        "CREATE_PROJECTS"
      ],
      "reportingPermissions": [
        "READ_SALES_REPORTS"
      ]
    },
    "tenantId": "string",
    "truncatedKey": "string"
  }
]
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Find all API keys for a user in the current tenant (or any tenant if super admin)

GET
/api-key/all/{userId}
AuthorizationBearer <token>

In: header

Path Parameters

userId*string

The id of the user to retrieve API keys for

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/api-key/all/string"
[
  {
    "created": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "expiration": "2019-08-24T14:15:22Z",
    "id": "string",
    "lastUsed": "2019-08-24T14:15:22Z",
    "name": "string",
    "permissions": {
      "appPermissions": [
        "CREATE_APIKEYS"
      ],
      "assetManagementPermissions": [
        "CREATE_ASSETS"
      ],
      "calendarPermissions": [
        "CREATE_CALENDAR_EVENTS"
      ],
      "communicationsPermissions": [
        "CREATE_TEMPLATES"
      ],
      "configuratorPermissions": [
        "CREATE_CONCEPTS"
      ],
      "crmPermissions": [
        "CREATE_LEADS"
      ],
      "financePermissions": [
        "CREATE_CLIENTS"
      ],
      "hrPermissions": [
        "CREATE_EMPLOYEES"
      ],
      "inventoryPermissions": [
        "CREATE_INVENTORY"
      ],
      "productionPermissions": [
        "CREATE_PRODUCTION"
      ],
      "productsPermissions": [
        "CREATE_PRODUCTS"
      ],
      "projectsPermissions": [
        "CREATE_PROJECTS"
      ],
      "reportingPermissions": [
        "READ_SALES_REPORTS"
      ]
    },
    "tenantId": "string",
    "truncatedKey": "string"
  }
]
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Delete all API keys for a user in the current tenant (or any tenant if super admin)

DELETE
/api-key/all/{userId}
AuthorizationBearer <token>

In: header

Path Parameters

userId*string

The id of the user to delete API keys for

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:18080/api/v1/api-key/all/string"
Empty
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Get valid permissions for the current user

GET
/api-key/valid-permissions
AuthorizationBearer <token>

In: header

Query Parameters

isApiKey?boolean

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/api-key/valid-permissions"
{
  "appPermissions": [
    "CREATE_APIKEYS"
  ],
  "assetManagementPermissions": [
    "CREATE_ASSETS"
  ],
  "calendarPermissions": [
    "CREATE_CALENDAR_EVENTS"
  ],
  "communicationsPermissions": [
    "CREATE_TEMPLATES"
  ],
  "configuratorPermissions": [
    "CREATE_CONCEPTS"
  ],
  "crmPermissions": [
    "CREATE_LEADS"
  ],
  "financePermissions": [
    "CREATE_CLIENTS"
  ],
  "hrPermissions": [
    "CREATE_EMPLOYEES"
  ],
  "inventoryPermissions": [
    "CREATE_INVENTORY"
  ],
  "productionPermissions": [
    "CREATE_PRODUCTION"
  ],
  "productsPermissions": [
    "CREATE_PRODUCTS"
  ],
  "projectsPermissions": [
    "CREATE_PROJECTS"
  ],
  "reportingPermissions": [
    "READ_SALES_REPORTS"
  ]
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Delete API key

DELETE
/api-key/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

The key identifier of the API key to delete

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:18080/api/v1/api-key/string"
Empty
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Rename API key

PATCH
/api-key/{id}/name
AuthorizationBearer <token>

In: header

Path Parameters

id*string

The id of the API key to rename

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[key: string]?string

Response Body

application/json

application/json

application/json

curl -X PATCH "http://localhost:18080/api/v1/api-key/string/name" \  -H "Content-Type: application/json" \  -d '{    "property1": "string",    "property2": "string"  }'
Empty
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}