API Documentation

API Endpoint

Service Assignments

Service Assignments

To restrict time tracking & expense logging, there is an option to assign specific people to specific services. After enabling “Restricted by person” option on a budget, services with no one assigned will ignore this restriction, until you assign someone. For more details about how to achieve that, please refer to the help article.

ServiceAssignment diagram

Supported filter params

  • id

  • service_id (array)

  • person_id (array)

Supported sort params

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

GET /api/v2/service_assignments
Requestsreturns service assignments

GET  /api/v2/service_assignments?filter[service_id]=1136

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": "9",
      "type": "service_assignments",
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "1859"
          }
        },
        "person": {
          "meta": {
            "included": false
          }
        },
        "service": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/service_assignments?filter%5Bservice_id%5D=1136&page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/service_assignments?filter%5Bservice_id%5D=1136&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 assignments
GET/api/v2/service_assignments


GET /api/v2/service_assignments/1
Requestsreturns service assignment

GET  /api/v2/service_assignments/10

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": "10",
    "type": "service_assignments",
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1860"
        }
      },
      "person": {
        "meta": {
          "included": false
        }
      },
      "service": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets a service assignment
GET/api/v2/service_assignments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

service assignment id


POST /api/v2/service_assignments
Requestscreates service assignmentreturns errorreturns error

POST  /api/v2/service_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_assignments",
    "attributes": {},
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "1138"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "7515"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "12",
    "type": "service_assignments",
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1861"
        }
      },
      "person": {
        "meta": {
          "included": false
        }
      },
      "service": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/service_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_assignments",
    "attributes": {},
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "0"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "7518"
        }
      }
    }
  }
}
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"
      }
    }
  ]
}

POST  /api/v2/service_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_assignments",
    "attributes": {},
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "1141"
        }
      },
      "person": {
        "data": {
          "type": "people",
          "id": "7522"
        }
      }
    }
  }
}
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, per person is allowed",
      "source": {
        "pointer": "data/attributes/service"
      }
    }
  ]
}

Create a service assignment
POST/api/v2/service_assignments


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

PATCH  /api/v2/service_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
Body
{
  "data": {
    "type": "service_assignments",
    "attributes": {},
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "1143"
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "16",
    "type": "service_assignments",
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "1865"
        }
      },
      "person": {
        "meta": {
          "included": false
        }
      },
      "service": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/service_assignments/17

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_assignments",
    "attributes": {},
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "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"
      }
    }
  ]
}

PATCH  /api/v2/service_assignments/18

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_assignments",
    "attributes": {},
    "relationships": {
      "service": {
        "data": {
          "type": "services",
          "id": "1146"
        }
      }
    }
  }
}
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, per person is allowed",
      "source": {
        "pointer": "data/attributes/service"
      }
    }
  ]
}

Update a service assignment
PATCH/api/v2/service_assignments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

service assignment id


DELETE /api/v2/service_assignments/1
Requestsdeletes assignment

DELETE  /api/v2/service_assignments/20

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 assignment
DELETE/api/v2/service_assignments/{id}

URI Parameters
HideShow
id
number (required) Example: 1

service assignment id


Generated by aglio on 02 Aug 2025