Accounts


GET /accounts

Query Parameters

Parameter Type Description
notifications Boolean Filter accounts by notifications flag.
search String Filter accounts by matching the account name.
status Array Integer Filter accounts by their status id. Additionally, you can pass multiple status IDs as an array.
user Array Integer Filter accounts by users attached to the account. Additionally, you can pass multiple user IDs as an array. To retrieve the current authenticated user's accounts, you can pass the string 'me'.
with String Values to join to account resource.

{primary} You can filter the accounts you're assocated with by passing me to the user parameter.

Joining Resources

Here is a list of available resources to join on accounts.

['fields', 'logo', 'status', 'users', 'users.avatar']

Example Requests

All Accounts with their status with names like "foobar"

https://example.trak.io/api/v1/accounts?join=status&search=foobar

Account with ID 1 with their users

https://example.trak.io/api/v1/accounts/1?join=users

Example Response

{
    "success": true,
    "message": null,
    "data": {
        "data": [
            {
                "account_id": 1,
                "name": "Foo Bar",
                "status_id": 1,
                "status_name": "Collaborative",
                "notifications": true,
                "logo": null,
                "created_at": [
                    "raw": "2018-12-07 19:53:20",
                    "formatted": "December 7, 2018"
                ],
                "updated_at": [
                    "raw": "2019-06-01 19:53:20",
                    "formatted": "June 1, 2019"
                ],
                "status": {
                    "status_id": 1,
                    "name": "Collaborative",
                    "description": "...",
                    "color": "/docs/1.0/api-accounts#ffffff",
                    "active": true,
                    "default": true,
                    "collaborative": true
                },
                "tasks": [],
                "users": [
                    {
                        "user_id": 1,
                        "group_id": 1,
                        "group": {
                            "raw": "admin",
                            "formatted": "Trak Admin"
                        },
                        "first": "Trak",
                        "last": "Admin",
                        "fullname": "Trak Admin",
                        "email": "[email protected]",
                        "stage": "active",
                        "avatar": null,
                        "active": true,
                        "editor": true
                    },
                    ...
                ]
            },
            ...
        ],
        ...
    }
}

POST /accounts

Query Parameters

Parameter Type Required Description
name String true The name of the account.
status_id Integer true The status of the account.
notifications Boolean false Flag to determine if the account should deliver notifications.

Example Requests

{
    "name": "Example Account",
    "status_id": 1,
    "notifications": true
}

Example Response

{
    "success": true,
    "message": "API_ACCOUNT_CREATED",
    "data": {
        "account_id": 1,
        "name": "Example Account",
        "status_id": 1,
        "notifications": true,
        "updated_at": [
            "raw": "2019-06-01 19:53:20",
            "formatted": "June 1, 2019"
        ],
        "created_at": [
            "raw": "2019-06-01 19:53:20",
            "formatted": "June 1, 2019"
        ]
    }
}

PUT /accounts/{account_id}

Query Parameters

Parameter Type Required Description
name String true The name of the account.
status_id Integer true The status of the account.
notifications Boolean false Flag to determine if the account should deliver notifications.

Example Requests

{
    "name": "Updated Account",
    "status_id": 1,
    "notifications": true
}

Example Response

{
    "success": true,
    "message": "API_ACCOUNT_UPDATED",
    "data": {
        "account_id": 1,
        "name": "Updated Account",
        "status_id": 1,
        "notifications": true,
        "updated_at": [
            "raw": "2020-06-01 19:53:20",
            "formatted": "June 1, 2020"
        ],
        "created_at": [
            "raw": "2019-06-01 19:53:20",
            "formatted": "June 1, 2019"
        ]
    }
}

DELETE /accounts/{account_id}

{danger} Deleting an account will delete all attached tasks, notes, and field data.

Example Response

{
    "success": true,
    "message": "API_ACCOUNT_DELETED",
    "data": []
}