Back to top

Ushahidi Platform API

Ushahidi is a tool to collect and manage citizen reports. This describes the resources that make up the Ushahidi Platform API v3. If you have any problems or requests please contact support.

Current Version

Version of the Ushahidi Platform API are designated in the url /api/v3.

Resource Names

As resource names have changed over time some resource names in the API do not currently match the web interface.

API Name Frontend Name Description
Form Survey
Form Stage Task
Form Attribute Field
Tag Category Tags also have type: category, but this is the only type available at this moment
Set Collection Now mostly eliminated from the API, but in some places it still use

Schema

All data is sent and received as JSON.

All timestamps are returned in ISO 8601 format:

YYYY-MM-DDTHH:MM:SS+00:00

Individual Resouce Responses

When you fetch an individual resource, the response includes all attributes for that resource. Authorization sometimes effects the amount of detail included in the response (ie. fields may be omitted if you do not have permission to access them).

Individual resources always include URL and id properties

{
    "id": 1,
    "url": "https://demo.api.ushahidi.io/api/v3/resources/1"
}

Collection Responses

When you a fetch a collection of resources we return some metadata as well as a results array. The results array contains the full representation of the resource as decribed above.

{
    "count": "20",
    "results": [
        // Resources here
    ],
    "limit": "20",
    "offset": "0",
    "order": "asc",
    "orderby": "created",
    "curr": "https://demo.api.ushahidi.io/api/v3/resources?offset=0&limit=20",
    "next": "https://demo.api.ushahidi.io/api/v3/resources?offset=20&limit=20",
    "prev": "https://demo.api.ushahidi.io/api/v3/resources?offset=0&limit=20",
    "total_count": 100
}

Relations

When a resource has relations we return these as both a URL and id of the relation

{
    "relation": {
        "id": 1,
        "url": "https://demo.api.ushahidi.io/api/v3/resources/1"
    }
}

If a relation is empty it may be ommitted or null.

Parameters

Many API methods take optional parameters. For GET requests, any parameters not specified as a segment in the path can be passed as an HTTP query string parameter:

curl -i -H "Authorization: Bearer OAUTH-TOKEN" "https://demo.api.ushahidi.io/api/v3/forms/1/attributes?type=text"

In this example, the 1 value is provided for the formid parameter in the path while type is passed in the query string. Multiple parameters are treated as boolean AND ie. /posts?form=1&user=2 will return posts with form_id = 1 and user_id = 2

For POST and PUT requests, parameters not included in the URL should be encoded as JSON with a Content-Type of ‘application/json’:

curl -i -H "Authorization: Bearer OAUTH-TOKEN" -X POST -d '{"tag":"My tag"}' "https://demo.api.ushahidi.io/api/v3/tags"

Multivalue parameters

Often it is useful to pass multiple values to a query parameter ie. to return Posts owned by one of several users. In this case we usually accept comma separate values, or PHP style array parameters. For example:

posts?user=1,2,3
posts?user[]=1&user[]=2&user[]=3

Multi-value parameters will generally be evaluated as boolean OR.

Error responses

All error responses include an errors array. Error objects include at least status and title

{
    "errors": [{
        "status": 400,
        "title": "Some error"
    }]
}

Client Errors

There are a few possible types of client errors on API calls:

  1. Sending invalid JSON will result in a 400 Bad Request response.

    HTTP/1.1 400 Bad Request
    
    {
        "errors": [{
            "status": 400,
            "title": "Invalid json supplied. Error: 'Syntax error, malformed JSON'."
        }]
    }
    
  2. Requesting unsupported response formats (with ?format=something) will result in a 400 Bad Request response.

    HTTP/1.1 400 Bad Request
    
    {
        "errors": [{
            "status": 400,
            "title": "Bad formatting parameters. ..."
        }]
    }
    
  3. Sending invalid fields will result in a 422 Unprocessable Entity response.

    HTTP/1.1 422 Unprocessable Entity
    
    {
        "errors": [{
            "status": 422,
            "title": "Validation Error"
        }, {
            "status": 422,
            "title": "Username is already taken",
            "source": {
                "pointer": "/username"
            }
        }]
    }
    

Validation error objects have a source object so that your client can tell where the problem is. pointer is a JSONPath reference to the invalid field.

HTTP Verbs

Where possible this API strives to use appropriate HTTP verbs for each action.

Verb Description
GET Used for retrieving resources.
POST Used for creating resources.
PUT Used for replacing (updating) resources or collections.
DELETE Used for deleting resources.
OPTIONS Can be issued against any resource to get meta data.

Authentication

Most resources required an OAuth2 Token for authentication. See the Authorization with OAuth 2 section below.

Pagination

Requests that return multiple items may be paginated by default. You can traverse further results with the ?offset parameter. You should also set a custom limit with the ?limit parameter.

curl 'https://demo.api.ushahidi.io/api/v3/posts?limit=50&offset=50'

Note that offset numbering is 0-based and that omitting the ?offset parameter will default to ?offset=0.

Cross Origin Resource Sharing

The API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin.

Here is what the CORS preflight request looks like

curl -i https://demo.api.ushahidi.io/api/v3/posts -H "Origin: http://example.com" -X OPTIONS
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Authorization, Content-type
Allow: POST, GET, PUT, DELETE, OPTIONS
Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS

{
    "allowed_privileges": [
        "read",
        "create",
        "search"
    ]
}

Authorization with OAuth 2

Most API requests are authenticated with OAuth2.

OAuth 2 token exchange

The first step of OAuth is to exchange credentials for an access_token. This access_token is then used on subsequent resource requests.

Supported grant types:

  • client_credentials

  • password

Exchange credentials for token
POST/api/v3/oauth/token

Example URI

POST http://demo.api.ushahidi.io/api/v3/oauth/token
Request  Client Credentials grant
HideShow
Headers
Authorization: Basic ABCDEF
Body
{
  "grant_type": "client_credentials",
  "client_id": "Hello, world!",
  "client_secret": "Hello, world!",
  "scope": "post,user"
}
Schema
{
  "type": "object",
  "properties": {
    "grant_type": {
      "type": "string"
    },
    "client_id": {
      "type": "string"
    },
    "client_secret": {
      "type": "string"
    },
    "scope": {
      "type": "string"
    }
  },
  "required": [
    "grant_type",
    "client_id",
    "client_secret"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "access_token": "eyJhbGciOiJIUzI1NiJ9",
  "scope": "all",
  "expires_in": 300,
  "token_type": "Bearer"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "access_token": {
      "type": "string",
      "description": "valid access token"
    },
    "scope": {
      "type": "string",
      "description": "scopes of current token"
    },
    "expires_in": {
      "type": "number"
    },
    "token_type": {
      "type": "string"
    }
  },
  "required": [
    "access_token",
    "scope",
    "expires_in",
    "token_type"
  ]
}
Request  Password grant
HideShow
Body
{
  "grant_type": "password",
  "client_id": "Hello, world!",
  "client_secret": "Hello, world!",
  "username": "someuser@domain.com",
  "password": "somepassword",
  "scope": "post,user"
}
Schema
{
  "type": "object",
  "properties": {
    "grant_type": {
      "type": "string"
    },
    "client_id": {
      "type": "string"
    },
    "client_secret": {
      "type": "string"
    },
    "username": {
      "type": "string"
    },
    "password": {
      "type": "string"
    },
    "scope": {
      "type": "string"
    }
  },
  "required": [
    "grant_type",
    "client_id",
    "client_secret",
    "username",
    "password"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "access_token": "eyJhbGciOiJIUzI1NiJ9",
  "scope": "all",
  "expires_in": 300,
  "token_type": "Bearer"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "access_token": {
      "type": "string",
      "description": "valid access token"
    },
    "scope": {
      "type": "string",
      "description": "scopes of current token"
    },
    "expires_in": {
      "type": "number"
    },
    "token_type": {
      "type": "string"
    }
  },
  "required": [
    "access_token",
    "scope",
    "expires_in",
    "token_type"
  ]
}

Accessing a protected resource

Now we have an access_token we add that to the Authentication header on all resource requests.

Accessing a protected resource
GET/api/v3/protected

Example URI

GET http://demo.api.ushahidi.io/api/v3/protected
Request  With Valid token
HideShow
Headers
Authentication: Bearer accesstoken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "ok"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    }
  },
  "required": [
    "status"
  ]
}
Request  With Invalid or Expired token
HideShow
Headers
Authentication: Bearer invalidOrExpireToken
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 1,
      "title": "Hello, world!"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}
Request  With insufficient permissions
HideShow
Headers
Authentication: Bearer accesstoken
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 1,
      "title": "Hello, world!"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Posts

List All Posts

List All Posts
GET/api/v3/posts{?form,user,set}

List all posts matching search criteria as supplied in query parameters. Multiple parameters are treated as boolean AND ie. /posts?form=1&user=2 will return posts with form_id = 1 and user_id = 2

Example URI

GET http://demo.api.ushahidi.io/api/v3/posts?form=17,18&user=32,33&set=1,2
URI Parameters
HideShow
q
string (optional) 

Return posts containing q text in title or content properties

form
number (optional) Example: 17,18

Form ID. Accepts multiple values, ie: ?form=17,19,32

user
number (optional) Example: 32,33

User ID. Accepts multiple values, ie: ?user=17,19,32

parent
number (optional) Example: 10,11

Parent Post ID. Accepts multiple values.

set
number (optional) Example: 1,2

Collection ID. (Collections are represented as Sets in the database. This naming should change to be more consistent in future)

tags
number (optional) Example: 1,2,3

Tag ID. Return Posts matching any of these Tags (Boolean OR)

tags[any]
number (optional) Example: 1,6,9

Return posts matching any of these Tag IDs (Boolean OR)

tags[all]
number (optional) Example: 1,7,10

Return posts matching all of these Tag IDs (Boolean AND)

status
string (optional) Example: draft

Status of Posts to be returned

Choices: archived draft published

locale
string (optional) Example: en_us
created_before
string (optional) Example: 1970-01-01T00:00:00+00:00
created_after
string (optional) Example: 1970-01-01T00:00:00+00:00
updated_before
string (optional) Example: 1970-01-01T00:00:00+00:00
updated_after
string (optional) Example: 1970-01-01T00:00:00+00:00
bbox
string (optional) 
values
string (optional) 
current_stage
number (optional) 

(Experimental)

center_point
string (optional) 
within_km
number (optional) 
published_to
array(string) (optional) 

Roles this post is published to (Deprecated)

include_types
string (optional) 
include_attributes
string (optional) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
      "parent": {
        "id": "1",
        "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
      },
      "title": "Need help",
      "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
      "created": "2014-11-11T08:40:51+00:00",
      "updated": "2014-11-11T08:40:51+00:00",
      "form": {
        "id": "1",
        "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
      },
      "user": {
        "id": "1",
        "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
      },
      "message": "",
      "color": "#2274B4",
      "type": "report",
      "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
      "author_email": "null",
      "author_realname": "null",
      "status": "published",
      "locale": "en_us",
      "published_to": [],
      "completed_stages": [],
      "values": {
        "AttributeID1": [
          "Value 1",
          "Value 2"
        ],
        "AttributeID2": [
          {
            "lat": "2.456",
            "lon": "1.234"
          }
        ]
      },
      "tags": [
        {
          "id": 1,
          "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
        }
      ],
      "sets": [
        "1",
        "2"
      ],
      "source": "SMS",
      "contact": "rjmackay",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://quakemap.api.ushahidi.io/api/v3/posts?offset=0&limit=20",
  "next": "https://quakemap.api.ushahidi.io/api/v3/posts?offset=20&limit=20",
  "prev": "https://quakemap.api.ushahidi.io/api/v3/posts?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a New Post

Create a New Post
POST/api/v3/posts

Example URI

POST http://demo.api.ushahidi.io/api/v3/posts
Request  With permission to view created post
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Request  Without permission to view created post
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Response  204
Request  With invalid post data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Individual Post

Get a Post
GET/api/v3/posts/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/posts/id
URI Parameters
HideShow
id
number (required) 

ID of the Post

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 404,
      "title": "Resource could not be found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Update a Post
PUT/api/v3/posts/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/posts/id
URI Parameters
HideShow
id
number (required) 

ID of the Post

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 404,
      "title": "Resource could not be found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Post
DELETE/api/v3/posts/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/posts/1
URI Parameters
HideShow
id
number (required) Example: 1

ID of the Post

Request  Delete a post
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}
Request  Delete non existent post
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 404,
      "title": "Resource could not be found"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Posts Statistics

Get Posts Grouped Totals
GET/api/v3/posts/stats{?group_by,group_by_attribute_key,group_by_tags}

Example URI

GET http://demo.api.ushahidi.io/api/v3/posts/stats?group_by=status&group_by_attribute_key=region&group_by_tags=
URI Parameters
HideShow
group_by
string (optional) Example: status

Variable to group by

  • Members:
    • status
    • form
    • tags - Use with group_by_tags
    • attribute - Use with group_by_attribute_key
group_by_tags
number (optional) 

Group by children of this Parent Tag ID

group_by_attribute_key
string (optional) Example: region

Attribute key. Posts will be grouped by the value of this attribute.

Response  200
HideShow
Headers
Content-Type: application/json

Get Post Totals Over Time
GET/api/v3/posts/stats?timeline=1&{?timeline,timeline_interval,timeline_attribute,group_by,group_by_tags,group_by_attribute_key}

Example URI

GET http://demo.api.ushahidi.io/api/v3/posts/stats?timeline=1&?timeline=1&timeline_interval=86400&timeline_attribute=updated&group_by=status&group_by_tags=&group_by_attribute_key=region
URI Parameters
HideShow
timeline
boolean (required) Example: 1

Enable grouping by time

timeline_interval
string (optional) Example: 86400

Interval of time to group by, in seconds

timeline_attribute
string (optional) Example: updated

Property of the post to use as the time variable

group_by
string (optional) Example: status

Variable to group by

  • Members:
    • status
    • form
    • tags - Use with group_by_tags
    • attribute - Use with group_by_attribute_key
group_by_tags
number (optional) 

Group by children of this Parent Tag ID

group_by_attribute_key
string (optional) Example: region

Attribute key. Posts will be grouped by the value of this attribute.

Response  200
HideShow
Headers
Content-Type: application/json

Media

Media

List All Media
GET/api/v3/media{?user,orphans}

Example URI

GET http://demo.api.ushahidi.io/api/v3/media?user=&orphans=
URI Parameters
HideShow
user
number (required) 

User ID

orphans
boolean (required) 

Only return orphaned Media which are not attached to a post

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/media/530",
      "user": {
        "id": 1,
        "url": "https://demo.api.ushahidi.io/api/v3/users/530"
      },
      "caption": "A sample image",
      "created": "1970-01-01T00:00:00+00:00",
      "updated": "1970-01-01T00:00:00+00:00",
      "mime": "image/png",
      "original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
      "original_file_size": 1,
      "original_width": 1,
      "original_height": 1,
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/media?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/media?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/media?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Upload Media
POST/api/v3/media

Media Uploads use the multipart/form-data content type, rather than application/json as in other API calls.

Example URI

POST http://demo.api.ushahidi.io/api/v3/media
Request
HideShow
Headers
Content-Type: multipart/form-data;boundary=----FormBoundary8M3sSU13ul5lXSJm
Content-Length: 1234
Body
----FormBoundary8M3sSU13ul5lXSJm
content-disposition: form-data; name="caption"

A sample image
----FormBoundary8M3sSU13ul5lXSJm
content-disposition: form-data; name="sample"; filename="sample.png"
Content-Type: Mime-Type
Content-Transfer-Encoding: binary

binarydata
----FormBoundary8M3sSU13ul5lXSJm--
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/media/530",
  "user": {
    "id": 1,
    "url": "https://demo.api.ushahidi.io/api/v3/users/530"
  },
  "caption": "A sample image",
  "created": "1970-01-01T00:00:00+00:00",
  "updated": "1970-01-01T00:00:00+00:00",
  "mime": "image/png",
  "original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
  "original_file_size": 1,
  "original_width": 1,
  "original_height": 1,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "caption": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "mime": {
      "type": "string"
    },
    "original_file_url": {
      "type": "string"
    },
    "original_file_size": {
      "type": "number"
    },
    "original_width": {
      "type": "number"
    },
    "original_height": {
      "type": "number"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}

Individual Media Upload

Get Media
GET/api/v3/media/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/media/id
URI Parameters
HideShow
id
number (required) 

ID of Media resource

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/media/530",
  "user": {
    "id": 1,
    "url": "https://demo.api.ushahidi.io/api/v3/users/530"
  },
  "caption": "A sample image",
  "created": "1970-01-01T00:00:00+00:00",
  "updated": "1970-01-01T00:00:00+00:00",
  "mime": "image/png",
  "original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
  "original_file_size": 1,
  "original_width": 1,
  "original_height": 1,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "caption": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "mime": {
      "type": "string"
    },
    "original_file_url": {
      "type": "string"
    },
    "original_file_size": {
      "type": "number"
    },
    "original_width": {
      "type": "number"
    },
    "original_height": {
      "type": "number"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}

Update Media
PUT/api/v3/media/{id}

Only the caption can be changed when updating Media resources. You cannot update the file upload. Instead you need to upload a new Media resource.

Example URI

PUT http://demo.api.ushahidi.io/api/v3/media/id
URI Parameters
HideShow
id
number (required) 

ID of Media resource

Request
HideShow
Body
{
  "caption": "\"A new caption\""
}
Schema
{
  "type": "object",
  "properties": {
    "caption": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/media/530",
  "user": {
    "id": 1,
    "url": "https://demo.api.ushahidi.io/api/v3/users/530"
  },
  "caption": "A sample image",
  "created": "1970-01-01T00:00:00+00:00",
  "updated": "1970-01-01T00:00:00+00:00",
  "mime": "image/png",
  "original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
  "original_file_size": 1,
  "original_width": 1,
  "original_height": 1,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "caption": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "mime": {
      "type": "string"
    },
    "original_file_url": {
      "type": "string"
    },
    "original_file_size": {
      "type": "number"
    },
    "original_width": {
      "type": "number"
    },
    "original_height": {
      "type": "number"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}

Delete Media
DELETE/api/v3/media/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/media/id
URI Parameters
HideShow
id
number (required) 

ID of Media resource

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/media/530",
  "user": {
    "id": 1,
    "url": "https://demo.api.ushahidi.io/api/v3/users/530"
  },
  "caption": "A sample image",
  "created": "1970-01-01T00:00:00+00:00",
  "updated": "1970-01-01T00:00:00+00:00",
  "mime": "image/png",
  "original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
  "original_file_size": 1,
  "original_width": 1,
  "original_height": 1,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "caption": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "mime": {
      "type": "string"
    },
    "original_file_url": {
      "type": "string"
    },
    "original_file_size": {
      "type": "number"
    },
    "original_width": {
      "type": "number"
    },
    "original_height": {
      "type": "number"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}

Tags

List All Tags

List All Tags
GET/api/v3/tags{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/tags?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
      "parent": {
        "id": "1",
        "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
      },
      "tag": "Some Tag",
      "slug": "some-tag",
      "type": "category",
      "color": "#00ff00",
      "icon": "marker",
      "description": "Hello, world!",
      "role": [
        "Hello, world!",
        "role1",
        "role2"
      ],
      "created": "2014-11-11T08:40:51+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/tags?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/tags?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/tags?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Tag

Create a Tag
POST/api/v3/tags

Example URI

POST http://demo.api.ushahidi.io/api/v3/tags
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Individual Tag

Get a Tag
GET/api/v3/tags/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/tags/id
URI Parameters
HideShow
id
number (required) 

ID of the Tag

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}

Update a Tag
PUT/api/v3/tags/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/tags/id
URI Parameters
HideShow
id
number (required) 

ID of the Tag

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Tag
DELETE/api/v3/tags/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/tags/id
URI Parameters
HideShow
id
number (required) 

ID of the Tag

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/tags/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/tags/1"
  },
  "tag": "Some Tag",
  "slug": "some-tag",
  "type": "category",
  "color": "#00ff00",
  "icon": "marker",
  "description": "Hello, world!",
  "role": [
    "Hello, world!",
    "role1",
    "role2"
  ],
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "tag": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "category"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "array"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "tag"
  ]
}

Collections

Collections

List All Collections
GET/api/v3/collections{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/collections?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
      "name": "Hello, world!",
      "description": "Hello, world!",
      "user": {
        "id": 1,
        "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
      },
      "view": "map",
      "view_options": [],
      "visible_to": [
        "admin"
      ],
      "featured": false,
      "created": "2014-11-11T08:40:51+00:00",
      "update": "2014-11-11T08:40:51+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/collections?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/collections?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/collections?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Collection
POST/api/v3/collections

Example URI

POST http://demo.api.ushahidi.io/api/v3/collections
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Individual Collection

Get a Collection
GET/api/v3/collections/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/collections/id
URI Parameters
HideShow
id
number (required) 

ID of the Collection

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}

Update a Collection
PUT/api/v3/collections/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/collections/id
URI Parameters
HideShow
id
number (required) 

ID of the Collection

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Collection
DELETE/api/v3/collections/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/collections/id
URI Parameters
HideShow
id
number (required) 

ID of the Collection

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/collection/530",
  "name": "Hello, world!",
  "description": "Hello, world!",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "view": "map",
  "view_options": [],
  "visible_to": [
    "admin"
  ],
  "featured": false,
  "created": "2014-11-11T08:40:51+00:00",
  "update": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Owner of the collection"
    },
    "view": {
      "type": "string",
      "enum": [
        "map",
        "list"
      ]
    },
    "view_options": {},
    "visible_to": {
      "type": "array",
      "description": "array of roles which can view this search"
    },
    "featured": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "update": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name",
    "created"
  ]
}

Collection Posts

Get all Posts in a collection
GET/api/v3/collections/{id}/posts

Example URI

GET http://demo.api.ushahidi.io/api/v3/collections/id/posts
URI Parameters
HideShow
id
number (required) 

ID of the Collection

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
      "parent": {
        "id": "1",
        "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
      },
      "title": "Need help",
      "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
      "created": "2014-11-11T08:40:51+00:00",
      "updated": "2014-11-11T08:40:51+00:00",
      "form": {
        "id": "1",
        "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
      },
      "user": {
        "id": "1",
        "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
      },
      "message": "",
      "color": "#2274B4",
      "type": "report",
      "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
      "author_email": "null",
      "author_realname": "null",
      "status": "published",
      "locale": "en_us",
      "published_to": [],
      "completed_stages": [],
      "values": {
        "AttributeID1": [
          "Value 1",
          "Value 2"
        ],
        "AttributeID2": [
          {
            "lat": "2.456",
            "lon": "1.234"
          }
        ]
      },
      "tags": [
        {
          "id": 1,
          "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
        }
      ],
      "sets": [
        "1",
        "2"
      ],
      "source": "SMS",
      "contact": "rjmackay",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/collections/1/posts?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/collections/1/posts?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/collections/1/posts?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Add a Post to a collection
POST/api/v3/collections/{id}/posts

Example URI

POST http://demo.api.ushahidi.io/api/v3/collections/id/posts
URI Parameters
HideShow
id
number (required) 

ID of the Collection

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 95
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Post ID to add to collection"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}

Remove a Post to from collection
DELETE/api/v3/collections/{id}/posts/{postid}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/collections/id/posts/postid
URI Parameters
HideShow
id
number (required) 

ID of the Collection

postid
number (required) 

ID of post to remove from collection

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}

Saved Searches

List All Saved Searches

List All Saved Searches
GET/api/v3/savedsearches{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/savedsearches?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
      "name": "Hello, world!",
      "description": "Hello, world!",
      "user": {
        "id": 1,
        "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
      },
      "view": "map",
      "view_options": [],
      "visible_to": [
        "admin"
      ],
      "featured": false,
      "filter": {
        "q": "test"
      },
      "created": "2014-11-11T08:40:51+00:00",
      "updated": "2014-11-11T08:40:51+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/savedsearches?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/savedsearches?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/savedsearches?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Import

CSV

List All
GET/api/v3/csv

Example URI

GET http://demo.api.ushahidi.io/api/v3/csv
Response  200
HideShow
Headers
Content-Type: application/json

Upload a CSV
POST/api/v3/csv

Example URI

POST http://demo.api.ushahidi.io/api/v3/csv
Response  200
HideShow
Headers
Content-Type: application/json

Get CSV
GET/api/v3/csv/

Example URI

GET http://demo.api.ushahidi.io/api/v3/csv/
Response  200
HideShow
Headers
Content-Type: application/json

Update CSV
PUT/api/v3/csv/

Example URI

PUT http://demo.api.ushahidi.io/api/v3/csv/
Response  200
HideShow
Headers
Content-Type: application/json

Delete CSV
DELETE/api/v3/csv/

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/csv/
Response  200
HideShow
Headers
Content-Type: application/json

Import a CSV
POST/api/v3/csv/import

Example URI

POST http://demo.api.ushahidi.io/api/v3/csv/import
Response  200
HideShow
Headers
Content-Type: application/json

Forms

Forms

List All Forms
GET/api/v3/forms{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/forms?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
      "parent": {
        "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
        "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
      },
      "name": "This is a Form",
      "description": "This is a form description",
      "color": "#ff00dd",
      "type": "report",
      "disable": false,
      "created": "2014-11-11T08:40:51+00:00",
      "updated": "2014-11-11T08:40:51+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/forms?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/forms?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/forms?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Form
POST/api/v3/forms

Example URI

POST http://demo.api.ushahidi.io/api/v3/forms
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Get a Form
GET/api/v3/forms/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/forms/id
URI Parameters
HideShow
id
number (required) 

ID of the Form

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}

Update a Form
PUT/api/v3/forms/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/forms/id
URI Parameters
HideShow
id
number (required) 

ID of the Form

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Form
DELETE/api/v3/forms/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/forms/id
URI Parameters
HideShow
id
number (required) 

ID of the Form

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/530",
  "parent": {
    "id": "https://demo.api.ushahidi.io/api/v3/forms/1",
    "url": "https://demo.api.ushahidi.io/api/v3/forms/1"
  },
  "name": "This is a Form",
  "description": "This is a form description",
  "color": "#ff00dd",
  "type": "report",
  "disable": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "description": "Parent Form **deprecated**"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "report"
      ]
    },
    "disable": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "name"
  ]
}

Form Stages

List All Stages in A Form
GET/api/v3/forms/stages{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/forms/stages?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
      "form_id": 1,
      "label": "Step 2",
      "priority": 1,
      "icon": "Hello, world!",
      "required": false,
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/stages?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/stages?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/stages?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Form Stage
POST/api/v3/forms/stages

Example URI

POST http://demo.api.ushahidi.io/api/v3/forms/stages
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Get a Form Stage
GET/api/v3/forms/stages/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/forms/stages/id
URI Parameters
HideShow
id
number (required) 

ID of the Form Stage

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}

Update a Form Stage
PUT/api/v3/forms/stages/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/forms/stages/id
URI Parameters
HideShow
id
number (required) 

ID of the Form Stage

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Form Stage
DELETE/api/v3/forms/stages/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/forms/stages/id
URI Parameters
HideShow
id
number (required) 

ID of the Form Stage

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
  "form_id": 1,
  "label": "Step 2",
  "priority": 1,
  "icon": "Hello, world!",
  "required": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "form_id": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "icon": {
      "type": "string",
      "description": "Icon **deprecated**"
    },
    "required": {
      "type": "boolean"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "form_id",
    "label"
  ]
}

Form Attributes

List All Attributes In Form
GET/api/v3/forms/attributes{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/forms/attributes?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
      "label": "Some field",
      "instructions": "Fill in the field",
      "input": "text",
      "type": "varchar",
      "required": true,
      "default": "Hello, world!",
      "priority": 1,
      "options": [],
      "cardinality": 1,
      "config": [],
      "form_stage_id": 1,
      "created": "2014-11-11T08:40:51+00:00",
      "updated": "2014-11-11T08:40:51+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/attributes?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/attributes?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/attributes?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Form Attribute
POST/api/v3/forms/attributes

Example URI

POST http://demo.api.ushahidi.io/api/v3/forms/attributes
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Get a Form Attribute
GET/api/v3/forms/attributes/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/forms/attributes/id
URI Parameters
HideShow
id
number (required) 

ID of the Form Attribute

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}

Update a Form Attribute
PUT/api/v3/forms/attributes/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/forms/attributes/id
URI Parameters
HideShow
id
number (required) 

ID of the Form Attribute

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Form Attribute
DELETE/api/v3/forms/attributes/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/forms/attributes/id
URI Parameters
HideShow
id
number (required) 

ID of the Form Attribute

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
  "label": "Some field",
  "instructions": "Fill in the field",
  "input": "text",
  "type": "varchar",
  "required": true,
  "default": "Hello, world!",
  "priority": 1,
  "options": [],
  "cardinality": 1,
  "config": [],
  "form_stage_id": 1,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "input": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "required": {
      "type": "boolean"
    },
    "default": {
      "type": "string"
    },
    "priority": {
      "type": "number"
    },
    "options": {},
    "cardinality": {
      "type": "number"
    },
    "config": {},
    "form_stage_id": {
      "type": "number"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "label",
    "input",
    "type",
    "cardinality",
    "form_stage_id"
  ]
}

Messages & Contacts

Messages

List All Messages
GET/api/v3/messages{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/messages?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
      "parent": {
        "id": "1",
        "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
      },
      "contact_id": 1,
      "user": {
        "id": 1,
        "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
      },
      "post_id": 13,
      "data_provider": "smssync",
      "data_provider_message_id": null,
      "title": "",
      "message": "",
      "type": "sms",
      "status": "pending",
      "direction": "outgoing",
      "additional_data": null,
      "notification_post_id": null,
      "created": "2014-11-11T08:40:51+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/messages?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/messages?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/messages?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Message
POST/api/v3/messages

Example URI

POST http://demo.api.ushahidi.io/api/v3/messages
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Individual Message

Get a Message
GET/api/v3/messages/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/messages/id
URI Parameters
HideShow
id
number (required) 

ID of the Message

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}

Get a Post for Message
GET/api/v3/messages/{id}/post

Example URI

GET http://demo.api.ushahidi.io/api/v3/messages/id/post
URI Parameters
HideShow
id
number (required) 

ID of the Contact

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/posts/1"
  },
  "title": "Need help",
  "content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "form": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
  },
  "user": {
    "id": "1",
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "message": "",
  "color": "#2274B4",
  "type": "report",
  "slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
  "author_email": "null",
  "author_realname": "null",
  "status": "published",
  "locale": "en_us",
  "published_to": [],
  "completed_stages": [],
  "values": {
    "AttributeID1": [
      "Value 1",
      "Value 2"
    ],
    "AttributeID2": [
      {
        "lat": "2.456",
        "lon": "1.234"
      }
    ]
  },
  "tags": [
    {
      "id": 1,
      "url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
    }
  ],
  "sets": [
    "1",
    "2"
  ],
  "source": "SMS",
  "contact": "rjmackay",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": "string"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "message": {
      "type": "string"
    },
    "color": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "author_email": {
      "type": "string"
    },
    "author_realname": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "locale": {
      "type": "string"
    },
    "published_to": {},
    "completed_stages": {
      "type": "array"
    },
    "values": {
      "type": "object",
      "properties": {
        "AttributeID1": {
          "type": "array"
        },
        "AttributeID2": {
          "type": "array"
        }
      },
      "description": "Custom field values. Object keys map to Form Attribute key field"
    },
    "tags": {
      "type": "array"
    },
    "sets": {
      "type": "array"
    },
    "source": {
      "type": "string",
      "description": "Original Message source ie. SMS, Twitter"
    },
    "contact": {
      "type": "string",
      "description": "Contact Identifier ie. SMS number, twitter handle"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "title",
    "content"
  ]
}

Update a Message
PUT/api/v3/messages/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/messages/id
URI Parameters
HideShow
id
number (required) 

ID of the Message

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Message
DELETE/api/v3/messages/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/messages/id
URI Parameters
HideShow
id
number (required) 

ID of the Message

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/messages/530",
  "parent": {
    "id": "1",
    "url": "https://demo.api.ushahidi.io/api/v3/messages/1"
  },
  "contact_id": 1,
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "post_id": 13,
  "data_provider": "smssync",
  "data_provider_message_id": null,
  "title": "",
  "message": "",
  "type": "sms",
  "status": "pending",
  "direction": "outgoing",
  "additional_data": null,
  "notification_post_id": null,
  "created": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "parent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "contact_id": {
      "type": "number"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "post_id": {
      "type": [
        "number",
        "null"
      ]
    },
    "data_provider": {
      "type": "string"
    },
    "data_provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "description": "<!-- + datetime -- unused -->\n"
    },
    "type": {
      "type": "string",
      "enum": [
        "sms",
        "email",
        "twitter",
        "phone"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "received",
        "sent",
        "pending_poll",
        "unknown"
      ]
    },
    "direction": {
      "type": "string",
      "enum": [
        "outgoing",
        "incoming"
      ]
    },
    "additional_data": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "Additional data from source"
    },
    "notification_post_id": {
      "type": [
        "number",
        "null"
      ],
      "description": "When message is a notification, contains post_id we're notifying users about"
    },
    "created": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "message"
  ]
}

Contacts

List All Contacts
GET/api/v3/contacts{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/contacts?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
      "user": {
        "id": 1,
        "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
      },
      "data_provider": "Hello, world!",
      "type": "email",
      "contact": "987654321",
      "can_notify": false,
      "created": "2014-11-11T08:40:51+00:00",
      "updated": "2014-11-11T08:40:51+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/contacts?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/contacts?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/contacts?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Contact
POST/api/v3/contacts

Example URI

POST http://demo.api.ushahidi.io/api/v3/contacts
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Individual Contact

Get a Contact
GET/api/v3/contacts/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/contacts/id
URI Parameters
HideShow
id
number (required) 

ID of the Contact

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}

Update a Contact
PUT/api/v3/contacts/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/contacts/id
URI Parameters
HideShow
id
number (required) 

ID of the Contact

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Contact
DELETE/api/v3/contacts/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/contacts/id
URI Parameters
HideShow
id
number (required) 

ID of the Contact

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/contact/530",
  "user": {
    "id": 1,
    "url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
  },
  "data_provider": "Hello, world!",
  "type": "email",
  "contact": "987654321",
  "can_notify": false,
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "number"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "data_provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "email",
        "twitter",
        "phone"
      ]
    },
    "contact": {
      "type": "string"
    },
    "can_notify": {
      "type": "boolean"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "contact"
  ]
}

Users & Roles

Users

List All Users
GET/api/v3/users{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/users?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/users/530",
      "created": "2014-11-11T08:40:51+00:00",
      "updated": "2014-11-11T08:40:51+00:00",
      "email": "test@ushahidi.com",
      "realname": "Test User",
      "logins": 2,
      "failed_attempts": 3,
      "last_login": "2014-11-11T08:40:51+00:00",
      "last_attempt": "2014-11-11T08:40:51+00:00",
      "role": "Hello, world!",
      "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/users?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/users?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/users?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a User
POST/api/v3/users

Example URI

POST http://demo.api.ushahidi.io/api/v3/users
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Individual User

Get a User
GET/api/v3/users/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/users/id
URI Parameters
HideShow
id
number (required) 

ID of the User

Request  with access to full user
HideShow
Headers
Authorization: Bearer someAdminToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}
Request  with access to partial user
HideShow
Headers
Authorization: Bearer someClientOnlyToken
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "realname": "Test User",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}

Get Current User
GET/api/v3/users/me

This is a special case of /api/v3/users/{id}. With id=me we load the user associated with the current oauth token.

Example URI

GET http://demo.api.ushahidi.io/api/v3/users/me
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}

Update a User
PUT/api/v3/users/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/users/id
URI Parameters
HideShow
id
number (required) 

ID of the User

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a User
DELETE/api/v3/users/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/users/id
URI Parameters
HideShow
id
number (required) 

ID of the User

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/users/530",
  "created": "2014-11-11T08:40:51+00:00",
  "updated": "2014-11-11T08:40:51+00:00",
  "email": "test@ushahidi.com",
  "realname": "Test User",
  "logins": 2,
  "failed_attempts": 3,
  "last_login": "2014-11-11T08:40:51+00:00",
  "last_attempt": "2014-11-11T08:40:51+00:00",
  "role": "Hello, world!",
  "gravatar": "982d5f5e2b53f4843ca1fe521025b342",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "created": {
      "type": "string"
    },
    "updated": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": "string"
    },
    "realname": {
      "type": "string"
    },
    "logins": {
      "type": "number"
    },
    "failed_attempts": {
      "type": "number"
    },
    "last_login": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_attempt": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "gravatar": {
      "type": "string",
      "description": "Gravatar Hash"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  }
}

Roles

List All Roles
GET/api/v3/roles{?q}

Example URI

GET http://demo.api.ushahidi.io/api/v3/roles?q=
URI Parameters
HideShow
q
string (required) 
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "count": "20",
  "results": [
    {
      "id": 530,
      "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
      "name": "Hello, world!",
      "display_name": "Hello, world!",
      "description": "Hello, world!",
      "permissions": [
        "Manage Users",
        "Manage Posts",
        "Manage Settings",
        "Bulk Data Import"
      ],
      "protected": false,
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "20",
  "offset": "0",
  "order": "asc",
  "orderby": "created",
  "curr": "https://demo.api.ushahidi.io/api/v3/roles?offset=0&limit=20",
  "next": "https://demo.api.ushahidi.io/api/v3/roles?offset=20&limit=20",
  "prev": "https://demo.api.ushahidi.io/api/v3/roles?offset=0&limit=20",
  "total_count": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "count": {
      "type": "string"
    },
    "results": {
      "type": "array"
    },
    "limit": {
      "type": "string"
    },
    "offset": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "orderby": {
      "type": "string"
    },
    "curr": {
      "type": "string"
    },
    "next": {
      "type": "string"
    },
    "prev": {
      "type": "string"
    },
    "total_count": {
      "type": "number"
    }
  }
}

Create a Role
POST/api/v3/roles

Example URI

POST http://demo.api.ushahidi.io/api/v3/roles
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Individual Role

Get a Role
GET/api/v3/roles/{id}

Example URI

GET http://demo.api.ushahidi.io/api/v3/roles/id
URI Parameters
HideShow
id
number (required) 

ID of the Role

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}

Update a Role
PUT/api/v3/roles/{id}

Example URI

PUT http://demo.api.ushahidi.io/api/v3/roles/id
URI Parameters
HideShow
id
number (required) 

ID of the Role

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}
Request  With invalid data
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": 422,
      "title": "Validation Error"
    },
    {
      "status": 422,
      "title": "Field is required",
      "source": {
        "pointer": "/field"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "array"
    }
  },
  "required": [
    "errors"
  ]
}

Delete a Role
DELETE/api/v3/roles/{id}

Example URI

DELETE http://demo.api.ushahidi.io/api/v3/roles/id
URI Parameters
HideShow
id
number (required) 

ID of the Role

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 530,
  "url": "https://demo.api.ushahidi.io/api/v3/roles/530",
  "name": "Hello, world!",
  "display_name": "Hello, world!",
  "description": "Hello, world!",
  "permissions": [
    "Manage Users",
    "Manage Posts",
    "Manage Settings",
    "Bulk Data Import"
  ],
  "protected": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "url": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "type": "array"
    },
    "protected": {
      "type": "boolean",
      "description": "Can this role be modified/deleted?"
    },
    "allowed_privileges": {
      "type": "array",
      "description": "Allowed privileges on this resource"
    }
  },
  "required": [
    "protected"
  ]
}

Config

Config

List All Config Groups
GET/api/v3/config

Example URI

GET http://demo.api.ushahidi.io/api/v3/config
Response  200

Get a Config Group
GET/api/v3/config/

Example URI

GET http://demo.api.ushahidi.io/api/v3/config/
Response  200

Update a Config Group
PUT/api/v3/config/

Example URI

PUT http://demo.api.ushahidi.io/api/v3/config/
Response  200

Data Providers

List All Data Providers

List All Data Providers
GET/api/v3/dataproviders

Example URI

GET http://demo.api.ushahidi.io/api/v3/dataproviders
Response  200

Get a Data Provider

Get a Data Provider
GET/api/v3/dataproviders/

Example URI

GET http://demo.api.ushahidi.io/api/v3/dataproviders/
Response  200

Migrations

Migrations

Get Migration Status
GET/api/v3/migration

Example URI

GET http://demo.api.ushahidi.io/api/v3/migration
Response  200
HideShow
Headers
Content-Type: application/json

Migrate
POST/api/v3/migration/migrate

Example URI

POST http://demo.api.ushahidi.io/api/v3/migration/migrate
Response  200
HideShow
Headers
Content-Type: application/json

Rollback
POST/api/v3/migration/rollback

Example URI

POST http://demo.api.ushahidi.io/api/v3/migration/rollback
Response  200
HideShow
Headers
Content-Type: application/json

Get Migration Status
GET/api/v3/migration/status

Example URI

GET http://demo.api.ushahidi.io/api/v3/migration/status
Response  200
HideShow
Headers
Content-Type: application/json

Run migrations unauthenticated

Run migrations
GET/migrate

This endpoint exists to help bootstrap Ushahidi before the tables are created and without command line access. It can be run without authentication

Example URI

GET http://demo.api.ushahidi.io/migrate
Response  200
HideShow
Headers
Content-Type: application/json

Generated by aglio on 01 Aug 2016