/org

These methods allow you to create, delete and switch orgs. Other org methods allow you to invite and remove users from orgs.

Create an org

POST https://pm415.com/api/org

Creates an organization.

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

Request Body

NameTypeDescription

object

{"name" : "myOrg"}

{
    "success": true,
    "organization": {
        "name": "myOrg",
        "updated_at": "2019-04-20T19:22:13.740Z",
        "created_at": "2019-04-20T19:22:13.740Z",
        "id": 15
    },
    "user": {
        "id": 4,
        "email": "mattreider@tmail.com",
        "password": "f115e42cc1a509ed5a03879574e71",
        "firstName": "Matthew",
        "lastName": "Reider",
        "isActive": 1,
        "confirmedAt": "2019-04-08T02:38:54.000Z",
        "createdAt": "2019-04-08T02:38:34.000Z",
        "updatedAt": "2019-04-08T02:38:54.000Z",
        "apiKey": "50ca9ba0f7b14f1932a1f81",
        "organizations": [
            {
                "id": 6,
                "name": "foo",
                "createdAt": "2019-04-08T02:38:34.000Z",
                "updatedAt": "2019-04-08T02:38:34.000Z",
                "roles": [
                    {
                        "id": 1,
                        "role": "Admin",
                        "createdAt": "2019-04-08T02:30:37.000Z",
                        "updatedAt": "2019-04-08T02:30:37.000Z"
                    }
                ]
            }
        ]
    }
}

Get org info

GET https://pm415.com/api/org

Gets info about all of the orgs. There are no request parameters - only a response.

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

{
    "success": true,
    "organizations": [
        {
            "id": 6,
            "name": "foo",
            "createdAt": "2019-04-08T02:38:34.000Z",
            "updatedAt": "2019-04-08T02:38:34.000Z",
            "roles": [
                {
                    "id": 1,
                    "role": "Admin",
                    "createdAt": "2019-04-08T02:30:37.000Z",
                    "updatedAt": "2019-04-08T02:30:37.000Z"
                }
            ]
        },
        {
            "id": 15,
            "name": "myOrg",
            "createdAt": "2019-04-20T19:22:13.000Z",
            "updatedAt": "2019-04-20T19:22:13.000Z",
            "roles": [
                {
                    "id": 1,
                    "role": "Admin",
                    "createdAt": "2019-04-08T02:30:37.000Z",
                    "updatedAt": "2019-04-08T02:30:37.000Z"
                }
            ]
        }
    ],
    "current": {
        "id": 6,
        "name": "foo",
        "createdAt": "2019-04-08T02:38:34.000Z",
        "updatedAt": "2019-04-08T02:38:34.000Z",
        "roles": [
            {
                "id": 1,
                "role": "Admin",
                "createdAt": "2019-04-08T02:30:37.000Z",
                "updatedAt": "2019-04-08T02:30:37.000Z"
            }
        ]
    }
}

Switch orgs

POST https://pm415.com/api/org/switch/:orgid

Switches orgs and generates a new token. This is useful if you are building a user interface, or CLI tool, and want to operate on one org at a time. The org you operate on is encapsulated in the token. Switching orgs, and tokens, allows you to operate on different orgs without having to save sessions artifacts (cookies, web storage, files, etc) on the client.

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to switch to

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

{
    "success": true,
    "organization": 1,
    "token": "00jf9w4dog73jfosdfu"
}

Update an org

PUT https://pm415.com/api/org/:orgid

Update an org's name

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to update

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

Request Body

NameTypeDescription

object

{"name": "updatedOrgName"}

Delete an org

DELETE https://pm415.com/api/org/:orgid

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to delete

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

{
    "success": true
}

Get users

GET https://pm415.com/api/org/:orgid/users

Gets information about an organization's users

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to query

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

{
    "success": true,
    "users": [
        {
            "userId": 4,
            "email": "mattr@tmail.com",
            "firstName": "Matthew",
            "lastName": "Reider",
            "isActive": 1,
            "role": "Admin"
        },
        {
            "userId": 6,
            "email": "suziereider@tmail.com",
            "firstName": "Suzie",
            "lastName": "Reider",
            "isActive": 1,
            "role": "Admin"
        }
    ]
}

Validate an user invite token

GET https://pm415.com/api/org/invite/?token=8s80f934kf94

Checks an invite token to see if it is valid and who it belongs to.This method is used by the PM415 user interface and may not have any other practical use case.

Query Parameters

NameTypeDescription

token

string

Invitation token sent to a user.

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

{
    success: true,
    "email": "mattreider@tmail.com",
    "organization": "my-org"
}

POST https://pm415.com/api/org/:orgid/invitelink

Creates an invite link for a new user.

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to work with

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

Request Body

NameTypeDescription

object

{email: “suziereider@tmail.com”}

{
   "success": true,
   "confirmUrl": "https://pm415.com/account/invite/?token=eyJh
}

Remove users

POST https://pm415.com//api/org/:orgid/users/remove

Removes users from an organization. This does not delete the user's profile - just the link between the org and the user. To add them back, you must re-invite them.

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to work with

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

Request Body

NameTypeDescription

object

{"usersId": ["4", "6"]}

{
   "success": true
}

Grant admin

PUT https://pm415.com/api/org/:orgid/admin/grant

Gives a user admin privileges. Admins can perform all operations on an org and its users.

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to work with

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

Request Body

NameTypeDescription

object

{"usersId": ["4", "6"]}

{
   "success": true
}

Revoke admin

PUT https://pm415.com/api/org/:orgid/admin/revoke

Revokes a user's admin privileges.

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to work with

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

Request Body

NameTypeDescription

object

{"usersId": ["4", "6"]}

{
   "success": true
}

Reset password

PUT https://pm415.com/api/org/:orgid/admin/resetpassword

Resets user passwords and sends emails with reset links.

Path Parameters

NameTypeDescription

:orgid

number

The ID of the org you want to work with

Headers

NameTypeDescription

Authentication

string

Authorization: Bearer 50ca9ba0f7b1444fa55d5

Request Body

NameTypeDescription

object

{"usersId": ["4", "6"]}

{
   "success": true
}

Last updated