Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Create JSM service using Terraform Provider

Apurva Kaushik
January 18, 2026

Hi Team,

I am attempting to create JSM services using our service.json file through the Atlassian Operations
provider "atlassian-operations"

The Terraform plan step completes successfully, but during terraform apply, the resource creation fails with the following error:
│ Error: Client Error
│ Unable to create JSM service, status code: 401. Got response:
│ {"code":401,"message":"Unauthorized"}

I have already verified that the provider configuration and credentials are set correctly.

I am using below details to configure the Provider.

provider "atlassian-operations" {
  domain_name   = var.atlassian_domain
  email_address = var.atlassian_email
  token         = var.atlassian_api_token
  cloud_id      = var.atlassian_cloud_id
}

Could you please help investigate why the API call is failing with a 401 during service creation?

Thank you.

1 answer

1 vote
Sebastian Krzewiński
Community Champion
January 19, 2026

Hi @Apurva Kaushik 

 

401 means that your token or email are incorrect. Can you check this again?

 

Regards,

Seba

Apurva Kaushik
January 19, 2026

Hi @Sebastian Krzewiński what do you mean by incorrect ? are you referring to scope permission or typo ?

 

Sebastian Krzewiński
Community Champion
January 20, 2026

Hi @Apurva Kaushik 

 

If something will be with token scope you will get message about that.

I was referring to wrong email or wrong token. 401 means that Jira can't recognise this user due wrong email or is able to recognise usr but auth token is wrong co Jira is blocking it.

 

Regards,

Seba

Apurva Kaushik
January 20, 2026

Hi @Sebastian Krzewiński 

Think I forgot to mentioned complete message

Unable to create JSM service, status code: 401. Got response:{"code":401,"message":"Unauthorized; scope does not match"}

Sebastian Krzewiński
Community Champion
January 21, 2026

Hi @Apurva Kaushik 

 

This change and explain everything. Please generate new token with more scopes. 

 

Regards,

Seba

Apurva Kaushik
January 21, 2026

Thanks for your suggestion but looks like there is a limitation As of now, Atlassian Service Accounts are not entitled to call Jira Service Management Operations API endpoints. This means that service accounts cannot directly interact with these APIs, either at a global scope or as part of a team.

This is weird. Do you have a another way around apart from creating user account ? 

Sebastian Krzewiński
Community Champion
January 22, 2026

what API you want to use with your service account?

Apurva Kaushik
January 22, 2026

JSM Operations API

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events