Users API


POST /api/v1/products/:product_id/users

Create a user

Parameters

Name Description
product_id * Numeric ID, or key of the product to create the user in
first_name * First name of the user
last_name * Last name of the user
email * Email of the user
role * Permissions of the user in the product one of: product_owner, contributor, reviewer, viewer, none

POST /api/v1/products/PRJ1/users

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/users" -d '{"user":{"email":"sam.doe@example.com","first_name":"sam","last_name":"doe","role":"product_owner"}}' -X POST \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1
{
  "user": {
    "email": "sam.doe@example.com",
    "first_name": "sam",
    "last_name": "doe",
    "role": "product_owner"
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "role": 20,
  "role_description": "Product Owner",
  "user": {
    "id": "6495838437887216547",
    "name": "sam doe",
    "email": "sam.doe@example.com",
    "created_at": "2017-12-04T23:30:44.562Z",
    "updated_at": "2017-12-04T23:30:44.598Z"
  }
}

POST /api/v1/products/:product_id/users

Create a contributor user

Parameters

Name Description
product_id * Numeric ID, or key of the product to create the user in
first_name * First name of the user
last_name * Last name of the user
email * Email of the user
role * Permissions of the user in the product one of: product_owner, contributor, reviewer, viewer, none

POST /api/v1/products/PRJ1/users

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/users" -d '{"user":{"email":"sam.doe@example.com","first_name":"sam","last_name":"doe","role":"contributor"}}' -X POST \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1
{
  "user": {
    "email": "sam.doe@example.com",
    "first_name": "sam",
    "last_name": "doe",
    "role": "contributor"
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "role": 30,
  "role_description": "Contributor",
  "user": {
    "id": "6495838439151978897",
    "name": "sam doe",
    "email": "sam.doe@example.com",
    "created_at": "2017-12-04T23:30:44.854Z",
    "updated_at": "2017-12-04T23:30:44.873Z"
  }
}

POST /api/v1/products/:product_id/users

Create a viewer user

Parameters

Name Description
product_id * Numeric ID, or key of the product to create the user in
first_name * First name of the user
last_name * Last name of the user
email * Email of the user
role * Permissions of the user in the product one of: product_owner, contributor, reviewer, viewer, none

POST /api/v1/products/PRJ1/users

Example CURL command

curl "https://secure.aha.io/api/v1/products/PRJ1/users" -d '{"user":{"email":"sam.doe@example.com","first_name":"sam","last_name":"doe","role":"viewer"}}' -X POST \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1
{
  "user": {
    "email": "sam.doe@example.com",
    "first_name": "sam",
    "last_name": "doe",
    "role": "viewer"
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "role": 50,
  "role_description": "Viewer",
  "user": {
    "id": "6495838439874490444",
    "name": "sam doe",
    "email": "sam.doe@example.com",
    "created_at": "2017-12-04T23:30:45.028Z",
    "updated_at": "2017-12-04T23:30:45.047Z"
  }
}

GET /api/v1/users

Get all users

Parameters

Name Description
email Email address to filter users by

GET /api/v1/users

Example CURL command

curl -g "https://secure.aha.io/api/v1/users" -X GET \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "users": [
    {
      "id": "501775768",
      "name": "Frank Sane",
      "email": "frank.sane@account2.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [

      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "435166761",
      "name": "Jane Smith",
      "email": "jane.smith@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [
        {
          "role": 50,
          "product_id": "131414752"
        }
      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "349538572",
      "name": "Sally Sane",
      "email": "sally.sane@account2.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [
        {
          "role": 30,
          "product_id": "131414752"
        }
      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "16338845",
      "name": "John Smith",
      "email": "john.smith@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [
        {
          "role": 50,
          "product_id": "131414752"
        }
      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "1049303076",
      "name": "George Gently",
      "email": "george.gently@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [
        {
          "role": 20,
          "product_id": "131414752"
        }
      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": true,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "126225962",
      "name": "Multi Account",
      "email": "mulit-account@trial-account.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [

      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": true,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "1020675218",
      "name": "Mary Humpty",
      "email": "mary.humpty@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [
        {
          "role": 20,
          "product_id": "131414752"
        },
        {
          "role": 20,
          "product_id": "517761884"
        },
        {
          "role": 20,
          "product_id": "610602692"
        }
      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "689956296",
      "name": "Henry Humpty",
      "email": "henry.humpty@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [
        {
          "role": 30,
          "product_id": "131414752"
        }
      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "733218216",
      "name": "Everso Gently",
      "email": "everso.gently@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [

      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": true,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "267654265",
      "name": "John's First (\"name\") 私 Smith",
      "email": "john-first.smith@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [

      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "601067208",
      "name": "Jeremy Smith",
      "email": "jeremy.smith@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [
        {
          "role": 40,
          "product_id": "131414752"
        }
      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": false,
      "identity_provider": {
        "type": "password"
      }
    },
    {
      "id": "869174989",
      "name": "Dirk Gently",
      "email": "dirk.gently@account1.com",
      "created_at": "2017-12-04T23:30:00.000Z",
      "updated_at": "2017-12-04T23:30:00.000Z",
      "accessed_at": null,
      "product_roles": [

      ],
      "enabled": true,
      "paid_seat": false,
      "administrator": true,
      "identity_provider": {
        "type": "password"
      }
    }
  ],
  "pagination": {
    "total_records": 12,
    "total_pages": 1,
    "current_page": 1
  }
}

GET /api/v1/products/:product_id/users

Get all users for a product

Parameters

Name Description
product_id * Numeric ID, or key of the product to get users for

GET /api/v1/products/PRJ1/users

Example CURL command

curl -g "https://secure.aha.io/api/v1/products/PRJ1/users" -X GET \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
X-Aha-Account: account1

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "project_users": [
    {
      "role": 20,
      "role_description": "Product Owner",
      "user": {
        "id": "1049303076",
        "name": "George Gently",
        "email": "george.gently@account1.com",
        "created_at": "2017-12-04T23:30:00.000Z",
        "updated_at": "2017-12-04T23:30:00.000Z"
      }
    },
    {
      "role": 50,
      "role_description": "Viewer",
      "user": {
        "id": "16338845",
        "name": "John Smith",
        "email": "john.smith@account1.com",
        "created_at": "2017-12-04T23:30:00.000Z",
        "updated_at": "2017-12-04T23:30:00.000Z"
      }
    },
    {
      "role": 50,
      "role_description": "Viewer",
      "user": {
        "id": "435166761",
        "name": "Jane Smith",
        "email": "jane.smith@account1.com",
        "created_at": "2017-12-04T23:30:00.000Z",
        "updated_at": "2017-12-04T23:30:00.000Z"
      }
    },
    {
      "role": 40,
      "role_description": "Reviewer",
      "user": {
        "id": "601067208",
        "name": "Jeremy Smith",
        "email": "jeremy.smith@account1.com",
        "created_at": "2017-12-04T23:30:00.000Z",
        "updated_at": "2017-12-04T23:30:00.000Z"
      }
    },
    {
      "role": 20,
      "role_description": "Product Owner",
      "user": {
        "id": "1020675218",
        "name": "Mary Humpty",
        "email": "mary.humpty@account1.com",
        "created_at": "2017-12-04T23:30:00.000Z",
        "updated_at": "2017-12-04T23:30:00.000Z"
      }
    },
    {
      "role": 30,
      "role_description": "Contributor",
      "user": {
        "id": "689956296",
        "name": "Henry Humpty",
        "email": "henry.humpty@account1.com",
        "created_at": "2017-12-04T23:30:00.000Z",
        "updated_at": "2017-12-04T23:30:00.000Z"
      }
    },
    {
      "role": 30,
      "role_description": "Contributor",
      "user": {
        "id": "349538572",
        "name": "Sally Sane",
        "email": "sally.sane@account2.com",
        "created_at": "2017-12-04T23:30:00.000Z",
        "updated_at": "2017-12-04T23:30:00.000Z"
      }
    }
  ],
  "pagination": {
    "total_records": 7,
    "total_pages": 1,
    "current_page": 1
  }
}

GET /api/v1/users/:id

Get a specific user

Parameters

Name Description
id * Numeric ID of the user to be retrieved

GET /api/v1/users/1049303076

Example CURL command

curl -g "https://secure.aha.io/api/v1/users/1049303076" -X GET \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "user": {
    "id": "1049303076",
    "name": "George Gently",
    "email": "george.gently@account1.com",
    "created_at": "2017-12-04T23:30:00.000Z",
    "updated_at": "2017-12-04T23:30:00.000Z",
    "accessed_at": null,
    "product_roles": [
      {
        "role": 20,
        "product_id": "131414752"
      }
    ]
  }
}

PUT /api/v1/users/:id

Update a user

Parameters

Name Description
id * Numeric ID of the user to be edited
first_name First name of the user
last_name Last name of the user
email Email of the user
enabled Sets whether the user is enabled
administrator Sets whether the user an administrator

PUT /api/v1/users/1020675218

Example CURL command

curl "https://secure.aha.io/api/v1/users/1020675218" -d '{"user":{"first_name":"Sarah","enabled":false}}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1
{
  "user": {
    "first_name": "Sarah",
    "enabled": false
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "id": "1020675218",
  "name": "Sarah Humpty",
  "email": "mary.humpty@account1.com",
  "created_at": "2017-12-04T23:30:00.000Z",
  "updated_at": "2017-12-04T23:30:45.605Z",
  "accessed_at": null,
  "product_roles": [
    {
      "role": 20,
      "product_id": "131414752"
    },
    {
      "role": 20,
      "product_id": "517761884"
    },
    {
      "role": 20,
      "product_id": "610602692"
    }
  ],
  "enabled": false,
  "paid_seat": false,
  "administrator": false,
  "identity_provider": {
    "type": "password"
  }
}

GET /api/v1/users/:id/product_roles

Get a user's product roles

Parameters

Name Description
id * Numeric ID of the user to be retrieved

GET /api/v1/users/1049303076/product_roles

Example CURL command

curl -g "https://secure.aha.io/api/v1/users/1049303076/product_roles" -X GET \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "product_roles": [
    {
      "role": 20,
      "product_id": "131414752"
    }
  ],
  "pagination": {
    "total_records": 1,
    "total_pages": 1,
    "current_page": 1
  }
}

POST /api/v1/users/:id/product_roles

Update a user's product roles

Parameters

Name Description
id * Numeric ID of the user to create roles for

POST /api/v1/users/1020675218/product_roles

Example CURL command

curl "https://secure.aha.io/api/v1/users/1020675218/product_roles" -d '{"product_role":{"role":"product_owner","product_id":702241743}}' -X POST \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1
{
  "product_role": {
    "role": "product_owner",
    "product_id": 702241743
  }
}

Response

Status: 200 OK
  Content-Type: application/json; charset=utf-8
{
  "role": 20,
  "product_id": "702241743"
}

DELETE /api/v1/users/:id/product_roles/:product_id

Delete a user's product roles

Parameters

Name Description
id * Numeric ID of the user to remove role for

DELETE /api/v1/users/1020675218/product_roles/131414752

Example CURL command

curl "https://secure.aha.io/api/v1/users/1020675218/product_roles/131414752" -d '' -X DELETE \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76" \
	-H "X-Aha-Account: account1"

Request

Content-Type: application/json
Accept: application/json
Authorization: Bearer 584b6d6b83405011f8c6903d2379f4afdf824cef867db391b7bcb5995f603a76
X-Aha-Account: account1

Response

Status: 204 No Content
  

Overview

API Resources