NAV
Developers
cURL ruby python php

API Reference

Authentication Token URL

https://api.learnamp.com/oauth/token

API Base URL for subsquent calls

https://api.learnamp.com/v1

Welcome to Learn Amp API reference.

The Learn Amp API is organised around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Getting Started

To get started, you will need:

  1. An account on the Learn Amp platform
  2. An API Key and Secret

If you don't have these, please contact us.

Authentication

Generate an Access Token from the Auth Token URL:

curl --location --request POST 'https://api.learnamp.com/oauth/token' \
--form 'client_id=YOUR-CLIENT-ID' \
--form 'client_secret=YOUR-CLIENT-SECRET' \
--form 'grant_type=client_credentials'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/oauth/token")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)

form_data = [
  ['client_id', 'YOUR-CLIENT-ID'],
  ['client_secret', 'YOUR-CLIENT-SECRET'],
  ['grant_type', 'client_credentials']
]

request.set_form form_data, 'multipart/form-data'

response = http.request(request)

puts response.read_body
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/oauth/token');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));

$request->addPostParameter(array(
  'client_id' => 'YOUR-CLIENT-ID',
  'client_secret' => 'YOUR-CLIENT-SECRET',
  'grant_type' => 'client_credentials'
));

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
import requests

url = "https://api.learnamp.com/oauth/token"

payload = {
  'client_id': 'YOUR-CLIENT-ID',
  'client_secret': 'YOUR-CLIENT-SECRET',
  'grant_type': 'client_credentials'
}

response = requests.request("POST", url, headers = [], data = payload, files = [])

print(response.text.encode('utf8'))

200 OK - successful response:

{
  "access_token":"abcd1234efgh5678",
  "token_type":"Bearer",
  "expires_in":7200,
  "scope":"public",
  "created_at":1601480215
}

The Learn Amp API is secured using the OAuth2 Client Credentials flow.

Before calls can be made to the API, an access token must be retrieved from the Auth Token URL.

POST https://api.learnamp.com/oauth/token

Data in Body

Parameter Value Description
client_id YOUR-CLIENT-ID API Credentials Client ID
client_secret YOUR-CLIENT-SECRET API Credentials Client Secret
grant_type client_credentials Required oath2 grant type

Subsequent API calls then require this access token to be present in an Authorization header:

Authorization: Bearer YOUR-ACCESS-TOKEN

Users

User Description

In Learn Amp, a User, is a person who can access the platform. User's belong to your company account, and have a status like Invite Pending, Active or Deactivated.

View All Users

View all users in your account:

curl --location --request GET 'https://api.learnamp.com/v1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/users")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body
import requests

url = "https://api.learnamp.com/v1/users"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/users');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

View all users.

GET https://api.learnamp.com/users

Response will be paginated see pagination

Optional Filters in URL Params

The following URL params by be included, to filter the result set:

GET https://api.learnamp.com/users?filters[email][email protected]

URL Param Value Description
filters[email] [email protected] Return user with matching email address

200 OK - successful response:

{
  "users": [
    {
      "id": 1,
      "firstName": "Test",
      "lastName": "User",
      "jobTitle": "Developer",
      "email": "[email protected]",
      "timeZone": "London",
      "language": "en",
      "role": "viewer",
      "profileUrl": "https://testaccount.learnamp.com/en/users/1",
      "status": {
          "status": "Confirmed",
          "time": "On 29 Nov 16"
      },
      "avatar": "AVATAR_IMAGE_URL",
      "manager": {
          "id": 17,
          "firstName": "Manager",
          "lastName": "User",
          "jobTitle": "Head of Ops",
          "email": "[email protected]",
          "timeZone": "New York",
          "language": "en-US",
          "role": "admin",
          "profileUrl": "https://testaccount.learnamp.com/en/users/17",
          "status": {
              "status": "Confirmed",
              "time": "On 20 Feb 17"
          }
      },
      "location": "London, UK",
      "primaryTeam": {
        "id": 15,
        "name": "Operations",
        "teamUsersCount": 10,
        "apiTeamPath": "/v1/teams/15.json",
        "apiTeamUsersPath": "/v1/teams/15/users.json",
        "manager": {
          "id": 17,
          "firstName": "Manager",
          "lastName": "User",
          "jobTitle": "Head of Ops",
          "email": "[email protected]",
          "timeZone": "New York",
          "language": "en-US",
          "role": "admin",
          "profileUrl": "https://testaccount.learnamp.com/en/users/17",
          "status": {
            "status": "Confirmed",
            "time": "On 20 Feb 17"
          }
        }
      },
      "secondaryTeams": []
    },
  ]
}

Show a User

Display details for a single user:

curl --location --request GET 'https://api.learnamp.com/v1/users/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/users/1")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body

import requests

url = "https://api.learnamp.com/v1/users/1"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/users/1');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Display user details for one specific user.

GET https://api.learnamp.com/users/{userId}

200 OK - successful response:

{
    "id": 1,
    "firstName": "Test",
    "lastName": "User",
    "jobTitle": "Developer",
    "email": "[email protected]",
    "timeZone": "London",
    "language": "en",
    "role": "viewer",
    "profileUrl": "https://testaccount.learnamp.com/en/users/1",
    "status": {
        "status": "Confirmed",
        "time": "On 29 Nov 16"
    },
    "avatar": "https://res.cloudinary.com/dfiav5ctj/image/upload/c_crop,g_custom/a_exif,c_fill,dpr_1.0,f_auto,q_auto,w_100/v1505401603/iysnlkr6sr6ys0dybeh0.jpg",
    "manager": {
        "id": 17,
        "firstName": "Test",
        "lastName": "Manager",
        "jobTitle": "Ops Director",
        "email": "[email protected]",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "profileUrl": "https://testaccount.learnamp.com/en/users/17",
        "status": {
            "status": "Confirmed",
            "time": "On 20 Feb 17"
        }
    },
    "location": "London, UK",
    "primaryTeam": {
        "id": 15,
        "name": "Operations",
        "teamUsersCount": 1,
        "apiTeamPath": "/v1/teams/15.json",
        "apiTeamUsersPath": "/v1/teams/15/users.json",
        "manager": {
          "id": 17,
          "firstName": "Test",
          "lastName": "Manager",
          "jobTitle": "Ops Director",
          "email": "[email protected]",
          "timeZone": "London",
          "language": "en",
          "role": "admin",
          "profileUrl": "https://testaccount.learnamp.com/en/users/17",
          "status": {
              "status": "Confirmed",
              "time": "On 20 Feb 17"
          }
        }
      }
    },
    "secondaryTeams": []
}

404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Create a User

Create a new user in your account:

curl --location --request POST 'https://api.learnamp.com/v1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form '[email protected]' \
--form 'firstName=Test' \
--form 'lastName=User' \
--form 'role=curator' \
--form 'language=fr' \
--form 'jobTitle=Developer' \
--form 'primaryTeamId=15' \
--form 'secondaryTeamIds[]=376' \
--form 'managerId=1' \
--form 'skipInvitation=true' \
--form 'secondaryTeamIds[]=377'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/users")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)

request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

form_data = [
  ['email', '[email protected]'],
  ['firstName', 'Test'],
  ['lastName', 'User'],
  ['role', 'curator'],
  ['language', 'fr'],
  ['jobTitle', 'Developer'],
  ['primaryTeamId', 15],
  ['secondaryTeamIds', [377,376]],
  ['managerId', 1],
  ['skipInvitation', 'true']
]

request.set_form form_data, 'multipart/form-data'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.learnamp.com/v1/users"

payload = {
  'email': '[email protected]',
  'firstName': 'Test',
  'lastName': 'User',
  'role': 'curator',
  'language': 'fr',
  'jobTitle': 'Developer',
  'primaryTeamId': 15,
  'secondaryTeamIds': [376,377],
  'managerId': 1,
  'skipInvitation': 'true'
}
files = []

headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("POST", url, headers = headers, data = payload, files = [])

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/users');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
$request->addPostParameter(array(
  'email' => '[email protected]',
  'firstName' => 'Test',
  'lastName' => 'User',
  'role' => 'curator',
  'language' => 'fr',
  'jobTitle' => 'Developer',
  'primaryTeamId' => 15,
  'secondaryTeamIds[]' => 376,
  'managerId' => '1',
  'skipInvitation' => 'true',
  'secondaryTeamIds[]' => 377
));
try {
  $response = $request->send();
  if ($response->getStatus() == 201) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Create a user and trigger an invite email.

POST https://api.learnamp.com/users

Data in Body

Parameter Example value Description (* required)
email [email protected] Email address of user (*)
firstName Test First name of user (*)
lastName User Last name of user (*)
language fr Primary language short code. One of: en, en-US, de, es-CO, fr, it, nl, pt-BR, pl, ru, zh-CN, zh-TW, ja, ar
jobTitle Developer Job title of user
role viewer user's role. One of: viewer, curator, admin, hr, reporter
primaryTeamId 15 Team ID of primary team see Teams
secondaryTeamIds [376,377] Array of Team IDs of seconary teams
managerId 1 User ID of this user's Manager (override manager, not primary team manager)
skipInvitation true Skip sending the user an invitation email immediately. If skipInvitation is not set, the user will be immediately sent an invitation email

201 Created - successful response:

{
    "id": 1905,
    "firstName": "Test",
    "lastName": "User",
    "jobTitle": "Developer",
    "email": "[email protected]",
    "timeZone": "London",
    "language": "fr",
    "role": "curator",
    "profileUrl": "https://testaccount.learnamp.com/en/users/1905",
    "status": {
      "status": "Not yet invited"
    }
}

400 Bad request - validation errors:

{
    "error": "email is missing, email is empty, firstName is missing, lastName is missing",
    "fullErrors": {
        "email": [
            "is missing",
            "is empty"
        ],
        "firstName": [
            "is missing"
        ],
        "lastName": [
            "is missing"
        ]
    }
}

Update a user

Update an existing user:

curl --location --request PUT 'http://api.learnamp.com/v1/users/1382' \
--header 'Authorization: Bearer SQn9nZAxgwPJcz-neajmNahBdlc2DRoNbUHwx9A4Rvw' \
--form 'firstName=Jim' \
--form 'lastName=Robinson' \
--form 'jobTitle=Businessman' \
--form 'language=en' \
--form 'primaryTeamId=379' \
--form 'managerId=1' \
--form '[email protected]' \
--form 'secondaryTeamIds[]=380'
require "uri"
require "net/http"

url = URI("http://api.learnamp.com/v1/users/1382")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer SQn9nZAxgwPJcz-neajmNahBdlc2DRoNbUHwx9A4Rvw"
form_data = [['firstName', 'Jim'],['lastName', 'Robinson'],['jobTitle', 'Businessman'],['language', 'en'],['primaryTeamId', '379'],['managerId', '1'],['email', '[email protected]'],['secondaryTeamIds[]', '380']]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "http://api.learnamp.com/v1/users/1382"

payload = {'firstName': 'Jim',
'lastName': 'Robinson',
'jobTitle': 'Businessman',
'language': 'en',
'primaryTeamId': '379',
'managerId': '1',
'email': '[email protected]',
'secondaryTeamIds[]': '380'}
files = [

]
headers = {
  'Authorization': 'Bearer SQn9nZAxgwPJcz-neajmNahBdlc2DRoNbUHwx9A4Rvw'
}

response = requests.request("PUT", url, headers=headers, data = payload, files = files)

print(response.text.encode('utf8'))

<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('http://api.learnamp.com/v1/users/1382');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer SQn9nZAxgwPJcz-neajmNahBdlc2DRoNbUHwx9A4Rvw'
));
$request->addPostParameter(array(
  'firstName' => 'Jim',
  'lastName' => 'Robinson',
  'jobTitle' => 'Businessman',
  'language' => 'en',
  'primaryTeamId' => '379',
  'managerId' => '1',
  'email' => '[email protected]',
  'secondaryTeamIds[]' => '380'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Update a user's details'.

PUT https://api.learnamp.com/users/{userId}

Data in Body

Parameter Example value Description (* required)
email [email protected] Email address of user (*)
firstName Test First name of user (*)
lastName User Last name of user (*)
language fr Primary language short code. One of: en, en-US, de, es-CO, fr, it, nl, pt-BR, pl, ru, zh-CN, zh-TW, ja, ar
jobTitle Developer Job title of user
primaryTeamId 15 Team ID of primary team see Teams
secondaryTeamIds [376,377] Array of Team IDs of seconary teams
managerId 1 User ID of this user's Manager (override manager, not primary team manager)

200 OK - successful response:

{
    "id": 1382,
    "firstName": "Jim",
    "lastName": "Robinson",
    "jobTitle": "Businessman",
    "email": "[email protected]",
    "timeZone": "London",
    "language": "en",
    "role": "admin",
    "profileUrl": "https://testaccount.learnamp.com/en/users/1382",
    "status": {
        "status": "Invite pending",
        "time": "Sent 25 Sep 19"
    },
    "avatar": "AVATAR_URL",
    "manager": {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Director",
        "email": "[email protected]",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "profileUrl": "https://testaccount.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        }
    },
    "location": null,
    "primaryTeam": {
        "id": 379,
        "name": "Team 1",
        "teamUsersCount": 3,
        "apiTeamPath": "/v1/teams/379.json",
        "apiTeamUsersPath": "/v1/teams/379/users.json",
        "manager": {
        }
    },
    "secondaryTeams": [
        {
            "id": 380,
            "name": "Team 2 - operations",
            "teamUsersCount": 1,
            "apiTeamPath": "/v1/teams/380.json",
            "apiTeamUsersPath": "/v1/teams/380/users.json",
            "manager": {
            }
        }
    ]
}

400 Bad request - validation errors:

{
    "error": "email is missing, email is empty, firstName is missing, lastName is missing",
    "fullErrors": {
        "email": [
            "is missing",
            "is empty"
        ],
        "firstName": [
            "is missing"
        ],
        "lastName": [
            "is missing"
        ]
    }
}

Deactivate a User

Deactivate a user:

curl --location --request PUT 'https://api.learnamp.com/v1/users/1/deactivate' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/users/1/deactivate")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body


import requests

url = "https://api.learnamp.com/v1/users/1/deactivate"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("PUT", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/users/1/deactivate');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 204) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Deactivate a user, so that they can no longer login. Their data is not removed.

PUT https://api.learnamp.com/users/{userId}/deactivate

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Delete a User

Delete a user:

curl --location --request DELETE 'https://api.learnamp.com/v1/users/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/users/1")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body


import requests

url = "https://api.learnamp.com/v1/users/1"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/users/1');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 204) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Delete a user, so that they can no longer login. Their data is removed.

DELETE https://api.learnamp.com/users/{userId}

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Teams

Team Description

In Learn Amp, a Team is any grouping of users. Teams may map to your organisation (e.g "Sales Department"), or they may be learning teams (e.g. "Trainee Managers").

View All Teams

View all teams in your account:

curl --location --request GET 'http://api.learnamp.com/v1/teams' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("http://api.learnamp.com/v1/teams")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body
import requests

url = "http://api.learnamp.com/v1/teams"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('http://api.learnamp.com/v1/teams');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

View all teams

GET https://api.learnamp.com/teams

Response will be paginated see pagination

200 OK - successful response:

{
    "teams": [
        {
            "id": 379,
            "name": "Test Team",
            "teamUsersCount": 2,
            "apiTeamPath": "/v1/teams/379.json",
            "apiTeamUsersPath": "/v1/teams/379/users.json",
            "manager": {
                "id": 7,
                "firstName": "Test",
                "lastName": "Manager",
                "jobTitle": "Ops Director",
                "email": "[email protected]",
                "timeZone": "London",
                "language": "en",
                "role": "admin",
                "profileUrl": "http://testaccount.learnamp.com/en/users/7",
                "status": {
                    "status": "Invite pending",
                    "time": "Sent 25 Sep 19"
                }
            }
        },
  ]
}

Show a Team

Display details for a single Team:

curl --location --request GET 'https://api.learnamp.com/v1/teams/383' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/teams/383")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body
import requests

url = "https://api.learnamp.com/v1/teams/383"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/teams/383');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Display details for one specific Team.

GET https://api.learnamp.com/teams/{teamId}

200 OK - successful response:

{
    "id": 383,
    "name": "Test Team",
    "teamUsersCount": 2,
    "apiTeamPath": "/v1/teams/383.json",
    "apiTeamUsersPath": "/v1/teams/383/users.json",
    "manager": {
        "id": 7,
        "firstName": "Test",
        "lastName": "Manager",
        "jobTitle": "Ops Director",
        "email": "[email protected]",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "profileUrl": "https://testaccount.learnamp.com/en/users/7",
        "status": {
            "status": "Invite pending",
            "time": "Sent 25 Sep 19"
        }
    },
    "users": [
        {
            "id": 1186,
            "firstName": "Test",
            "lastName": "User2",
            "jobTitle": "Customer Retention Manager",
            "email": "[email protected]",
            "timeZone": "London",
            "language": "en",
            "role": "viewer",
            "profileUrl": "https://testaccount.learnamp.com/en/users/1186",
            "status": {
                "status": "Confirmed",
                "time": "On 4 Mar 20"
            },
            "removeFromTeamUrl": "/v1/teams/383/users/1186.json"
        },
        {
            "id": 1281,
            "firstName": "Test",
            "lastName": "User",
            "jobTitle": "Sales director",
            "email": "[email protected]",
            "timeZone": "London",
            "language": "en",
            "role": "admin",
            "profileUrl": "https://testaccount.learnamp.com/en/users/1281",
            "status": {
                "status": "Confirmed",
                "time": "On 3 Mar 20"
            },
            "removeFromTeamUrl": "/v1/teams/383/users/1281.json"
        }
    ]
}

404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Create a Team

Create a new Team:

curl --location --request POST 'https://api.learnamp.com/v1/teams' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'name=New Team Test' \
--form 'managerId=1'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/teams")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"
form_data = [
  ['name', 'New Team Test'],
  ['managerId', '1']
]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.learnamp.com/v1/teams"

payload = {
  'name': 'New Team Test',
  'managerId': '1'
}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("POST", url, headers=headers, data = payload, files = [])

print(response.text.encode('utf8'))

<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/teams');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
$request->addPostParameter(array(
  'name' => 'New Team Test',
  'managerId' => '1'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 201) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Create a Team

POST https://api.learnamp.com/teams

Data in Body

Parameter Example value Description (* required)
name Sales Name of team
managerId 1 User ID of Team Manager

201 Created - successful response:

{
    "id": 449,
    "name": "New Team Test",
    "teamUsersCount": 0,
    "apiTeamPath": "/v1/teams/449.json",
    "apiTeamUsersPath": "/v1/teams/449/users.json",
    "manager": {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Sales Manager",
        "email": "[email protected]",
        "timeZone": "London",
        "language": "en",
        "role": "viewer",
        "profileUrl": "http://testaccount.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        }
    },
    "users": []
}

400 Bad request - validation errors:

{
    "error": "name is missing, name is empty",
    "fullErrors": {
        "name": [
            "is missing",
            "is empty"
        ]
    }
}

Update a Team

Update a team:

curl --location --request PUT 'https://api.learnamp.com/v1/teams/383' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'name=New Team Name' \
--form 'managerId=1'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/teams/383")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"
form_data = [['name', 'New Team Name'],['managerId', '1']]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.learnamp.com/v1/teams/383"

payload = {
  'name': 'New Team Name',
  'managerId': '1'
}

headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("PUT", url, headers=headers, data = payload, files = [])

print(response.text.encode('utf8'))

<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/teams/383');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
$request->addPostParameter(array(
  'name' => 'New Team Name',
  'managerId' => '1'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Update a Team

POST https://api.learnamp.com/items

Data in Body

Parameter Example value Description (* required)
name Marketing Team Name
managerId 1 User ID of Team Manager

200 OK - successful response:

{
    "id": 383,
    "name": "New Team Name",
    "teamUsersCount": 0,
    "apiTeamPath": "/v1/teams/383.json",
    "apiTeamUsersPath": "/v1/teams/383/users.json",
    "manager": {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Sales Manager",
        "email": "[email protected]",
        "timeZone": "London",
        "language": "en",
        "role": "viewer",
        "profileUrl": "http://testaccount.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        }
    },
    "users": []
}

400 Bad request - validation errors:

{
    "error": "name is missing, name is empty",
    "fullErrors": {
        "name": [
            "is missing",
            "is empty"
        ]
    }
}

Delete a Team

Delete a team:

curl --location --request DELETE 'https://api.learnamp.com/v1/teams/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/teams/1")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body
import requests

url = "https://api.learnamp.com/v1/teams/1"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/teams/1');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 204) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Delete a team. (Users are kept, but their association with team is removed).

DELETE https://api.learnamp.com/teams/{teamId}

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Team Users

View all users in a Team

View all users in a specific team:

curl --location --request GET 'http://api.learnamp.com/v1/teams/1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("http://api.learnamp.com/v1/teams/1/users")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body
import requests

url = "http://api.learnamp.com/v1/teams/1/users"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('http://api.learnamp.com/v1/teams/1/users');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

View a specific team, and include all users in that team.

GET https://api.learnamp.com/teams/{teamId}/users

200 OK - successful response:

{

  "id": 379,
  "name": "Test Team",
  "teamUsersCount": 2,
  "apiTeamPath": "/v1/teams/379.json",
  "apiTeamUsersPath": "/v1/teams/379/users.json",
  "manager": {
      "id": 7,
      "firstName": "Test",
      "lastName": "Manager",
      "jobTitle": "Ops Director",
      "email": "[email protected]",
      "timeZone": "London",
      "language": "en",
      "role": "admin",
      "profileUrl": "http://testaccount.learnamp.com/en/users/7",
      "status": {
          "status": "Invite pending",
          "time": "Sent 25 Sep 19"
      }
  },
  "users": [
        {
          "id": 1,
          "firstName": "Test",
          "lastName": "User",
          "jobTitle": "Developer",
          "email": "[email protected]",
          "timeZone": "London",
          "language": "en",
          "role": "viewer",
          "profileUrl": "https://testaccount.learnamp.com/en/users/1",
          "status": {
              "status": "Confirmed",
              "time": "On 29 Nov 16"
          },
          "avatar": "AVATAR_IMAGE_URL",
          "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "[email protected]",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                  "status": "Confirmed",
                  "time": "On 20 Feb 17"
              }
          },
          "location": "London, UK",
          "primaryTeam": {
            "id": 15,
            "name": "Operations",
            "teamUsersCount": 10,
            "apiTeamPath": "/v1/teams/15.json",
            "apiTeamUsersPath": "/v1/teams/15/users.json",
            "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "[email protected]",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                "status": "Confirmed",
                "time": "On 20 Feb 17"
              }
            }
          },
          "secondaryTeams": []
        },
      ]
    }
  ]
}

Add a User to a Team

Add a user to a team:

curl --location --request POST 'https://api.learnamp.com/v1/teams/1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'userId=1'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/teams/1/users")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"
form_data = [
  ['userId', '1']
]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.learnamp.com/v1/teams/1/users"

payload = {
  'userId': '1'
}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("POST", url, headers=headers, data = payload, files = [])

print(response.text.encode('utf8'))

<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/teams/1/users');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
$request->addPostParameter(array(
  'userId' => '1'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 201) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Adds a user to a Team.

POST https://api.learnamp.com/teams/{teamId}/users

Note that Team ID is passed in as a URL segment.

Data in Body

Parameter Example value Description (* required)
userId 1 User ID of user to add to team

201 Created - successful response:

```json
{

  "id": 1,
  "name": "Test Team",
  "teamUsersCount": 2,
  "apiTeamPath": "/v1/teams/1.json",
  "apiTeamUsersPath": "/v1/teams/1/users.json",
  "manager": {
      "id": 7,
      "firstName": "Test",
      "lastName": "Manager",
      "jobTitle": "Ops Director",
      "email": "[email protected]",
      "timeZone": "London",
      "language": "en",
      "role": "admin",
      "profileUrl": "http://testaccount.learnamp.com/en/users/7",
      "status": {
          "status": "Invite pending",
          "time": "Sent 25 Sep 19"
      }
  },
  "users": [
        {
          "id": 1,
          "firstName": "Test",
          "lastName": "User",
          "jobTitle": "Developer",
          "email": "[email protected]",
          "timeZone": "London",
          "language": "en",
          "role": "viewer",
          "profileUrl": "https://testaccount.learnamp.com/en/users/1",
          "status": {
              "status": "Confirmed",
              "time": "On 29 Nov 16"
          },
          "avatar": "AVATAR_IMAGE_URL",
          "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "[email protected]",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                  "status": "Confirmed",
                  "time": "On 20 Feb 17"
              }
          },
          "location": "London, UK",
          "primaryTeam": {
            "id": 15,
            "name": "Operations",
            "teamUsersCount": 10,
            "apiTeamPath": "/v1/teams/15.json",
            "apiTeamUsersPath": "/v1/teams/15/users.json",
            "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "[email protected]",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                "status": "Confirmed",
                "time": "On 20 Feb 17"
              }
            }
          },
          "secondaryTeams": []
        },
      ]
    }
  ]
}


> 400 Bad request - validation errors:

```json
{
    "error": "userId is missing, userId is empty",
    "fullErrors": {
        "userId": [
            "is missing",
            "is empty"
        ]
    }
}

Remove a User from a Team

Remove a user from team:

curl --location --request DELETE 'https://api.learnamp.com/v1/teams/1/users/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
require "uri"
require "net/http"

url = URI("https://api.learnamp.com/v1/teams/1/users/1")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer YOUR-ACCESS-TOKEN"

response = http.request(request)
puts response.read_body
import requests

url = "https://api.learnamp.com/v1/teams/1/users/1"

payload = {}
headers = {
  'Authorization': 'Bearer YOUR-ACCESS-TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.learnamp.com/v1/teams/1/users/1');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer YOUR-ACCESS-TOKEN'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 204) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

Delete a user from a team. (User and team are kept, but their association is removed).

DELETE https://api.learnamp.com/teams/{teamId}/users/{userId}

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Paginated Responses

All "View All" type responses will be paginated.

Pagination data in Reponse

Pagination data will be available in the following response headers:

Response Header Example value Description
Total 1032 Total number of matching results
Per-Page 10 Number of results per page
Total-Pages 103 Total number of pages

Apply pagination in Request

Pagination data can be set, by adding the following URL params in the request:

Request URL param Example value Description
page 2 Return the second page of results
perPage 20 Return 20 results per page

Example:

GET https://api.learnamp.com/tasks?page=3&perPage=30

Errors

The Learn Amp API uses the following error codes:

Error Code Meaning Description
400 Bad Request Your request is invalid.
401 Unauthorized Your API key is wrong.
403 Forbidden You do not have sufficient permissions to access the resource.
404 Not Found The specified resource could not be found.
406 Not Acceptable You requested a format that isn't json.
410 Gone The resources has been removed from our servers.
429 Too Many Requests You're requesting too many API calls.
500 Internal Server Error We had a problem with our server. Try again later.
503 Service Unavailable We're temporarily offline for maintenance. Please try again later.