API Documentation

API Endpoint

Service Type Assignments

Service Type Assignments

Service type assignments are tightly coupled with service types. For more details about what service types are, please refer to the help article. Assignments are described under the Assigning People to Service Types. To set everything up, here is additional help article.

Assignments are optional, but after assigning someone to specific service types and restricting time tracking by service type in the budget, you are ensuring that this person can only log their hours against assigned services categorized under assigned types.

ServiceTypeAssignment diagram

Supported filter params

  • id

  • person_id (array)

  • service_type_id (array)

Supported sort params

There are no supported params for service type assignment objects. There is also no default sorting.

GET /api/v2/service_type_assignments
Requestsreturns service type assignments

GET  /api/v2/service_type_assignments?filter[service_type_id]=1238

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "5",
      "type": "service_type_assignments",
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "1869"
          }
        },
        "person": {
          "meta": {
            "included": false
          }
        },
        "service_type": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/service_type_assignments?filter%5Bservice_type_id%5D=1238&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/service_type_assignments?filter%5Bservice_type_id%5D=1238&page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

Get service type assignments
GET/api/v2/service_type_assignments


GET /api/v2/service_type_assignments/1
Requestsreturns service type assignment

GET  /api/v2/service_type_assignments/6

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "6",
    "type": "service_type_assignments",
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1870"
        }
      },
      "person": {
        "meta": {
          "included": false
        }
      },
      "service_type": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets a service type assignment
GET/api/v2/service_type_assignments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

service type assignment id


POST /api/v2/service_type_assignments
Requestscreates service type assignmentreturns errorreturns error

POST  /api/v2/service_type_assignments

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "service_type_assignments",
    "attributes": {},
    "relationships": {
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "1240"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "7543"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "8",
    "type": "service_type_assignments",
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1871"
        }
      },
      "person": {
        "meta": {
          "included": false
        }
      },
      "service_type": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/service_type_assignments

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "service_type_assignments",
    "attributes": {},
    "relationships": {
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "0"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "7545"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "attribute is invalid",
      "source": {
        "pointer": "data/attributes/service_type"
      }
    }
  ]
}

POST  /api/v2/service_type_assignments

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "service_type_assignments",
    "attributes": {},
    "relationships": {
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "1243"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "7548"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "only one assignment per service type, per person is allowed",
      "source": {
        "pointer": "data/attributes/service_type"
      }
    }
  ]
}

Create a service type assignment
POST/api/v2/service_type_assignments


PATCH /api/v2/service_type_assignments/1
Requestsupdates service type assignmentreturns errorreturns error

PATCH  /api/v2/service_type_assignments/12

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "service_type_assignments",
    "attributes": {},
    "relationships": {
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "1245"
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "service_type_assignments",
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1875"
        }
      },
      "person": {
        "meta": {
          "included": false
        }
      },
      "service_type": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/service_type_assignments/13

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "service_type_assignments",
    "attributes": {},
    "relationships": {
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "0"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "attribute is invalid",
      "source": {
        "pointer": "data/attributes/service_type"
      }
    }
  ]
}

PATCH  /api/v2/service_type_assignments/14

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "service_type_assignments",
    "attributes": {},
    "relationships": {
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "1248"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "only one assignment per service type, per person is allowed",
      "source": {
        "pointer": "data/attributes/service_type"
      }
    }
  ]
}

Update a service type assignment
PATCH/api/v2/service_type_assignments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

service type assignment id


DELETE /api/v2/service_type_assignments/1
Requestsdeletes assignment

DELETE  /api/v2/service_type_assignments/16

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a service type assignment
DELETE/api/v2/service_type_assignments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

service type assignment id


Generated by aglio on 01 Aug 2025