web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Update Project Label Text via Dynamics API

(0) ShareShare
ReportReport
Posted on by 25

I'm using the dynamics CRM REST API to create projects, and manage some actions on Microsoft Projects online.
We're using labels, which we can apply to tasks, to signify various things.

Via the API I can read labels, and I can read and write the labels that have been assigned to each task (msdyn_projecttask).
The bit I haven't succeeded with is creating an API call which will change the text of a label from the default (Pink, Red, Yellow etc.) to something more useful.

Currently I'm having to manually edit the label text via the Project User Interface (e.g. see below).

Project-labels.png

Once I've renamed the label, when I fetch them via the API I can see the changed text, but I can't figure out a way to change it.

I'm able to fetch the project labels via:

GET orgXYZABC.api.crm4.dynamics.com/.../msdyn_projectlabels
(where {projectId} is the msydn_projectid of my project)

Which returns data like:

{
   "@odata.context":"https://orgXYZABC.api.crm4.dynamics.com/api/data/v9.1/$metadata#msdyn_projectlabels",
   "value":[
      {
         "@odata.etag":"W/\"21783358\"",
         "_owningbusinessunit_value":".....",
         "statecode":0,
         "msdyn_colorindex":192350000,
         "statuscode":1,
         "_createdby_value":"....",
         "_ownerid_value":".....",
         "_owningteam_value":".....",
         "modifiedon":"2022-11-02T13:32:26Z",
         "_modifiedby_value":"....",
         "versionnumber":21783358,
         "_msdyn_projectid_value":".....",
         "createdon":"2022-11-02T13:32:26Z",
         "msdyn_projectlabelid":"625eb1b2.....",
         "_owninguser_value":null,
         "overriddencreatedon":null,
         "importsequencenumber":null,
         "_modifiedonbehalfby_value":null,
         "msdyn_projectlabeltext": "Label One",
         "utcconversiontimezonecode":null,
         "_createdonbehalfby_value":null,
         "timezoneruleversionnumber":null
      },
....
   ]
}

I've tried:

PATCH orgXYZABC.api.crm4.dynamics.com/.../msdyn_projectlabels({labelId}})
(where {labelId} is one of the msdyn_projectlabelid values returned above)

headers: [
  "If-Match: *",
  "OData-MaxVersion: 4.0",
  "OData-Version: 4.0",
  "Accept: application/json",
  "Authorization: ...",
  "Content-Type: application/json; charset=utf-8"
]
body: {
    "msdyn_projectlabeltext": "Test Label 1"
}

But it fails and says:
"We\u2019re sorry. You cannot directly do 'Update' operation to 'msdyn_projectlabel'. Try editing it through the Resource editing UI via Project."

And I've tried:

PATCH https://orgXYZABC.api.crm4.dynamics.com/api/data/v9.1/msdyn_projectlabels

headers: [
"If-Match: *",
"OData-MaxVersion: 4.0",
"OData-Version: 4.0",
"Accept: application/json",
"Authorization: ...",
"Content-Type: application/json; charset=utf-8"

body: {
"msdyn_projectlabeltext": "Test Label 1"
"msdyn_projectlabelid@odata.bind": "/msdyn_projectlabels({labelId})"
}


Which fails, saying:
"The requested resource does not support http method 'PATCH'."

Also tried:

PUT https://orgXYZABC.api.crm4.dynamics.com/api/data/v9.1/msdyn_projectlabels({labelId})/msdyn_projectlabeltext

headers: [
  "OData-MaxVersion: 4.0",
  "OData-Version: 4.0",
  "Accept: application/json",
  "Authorization: ...",
  "Content-Type: application/json; charset=utf-8"
]
body: {
    "value": "Test Label 1"
}

But it fails with the same error as above.

There doesn't seem to be any documentation for this anywhere, if you google "msdyn_projectlabel" or "msdyn_projectlabels" (in quotes) you don't get a single result!

Anyone out there have any knowledge on whether this is possible / how to succeed?

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans