# Deployment REST API

**URL:** <https://forum.camunda.io/t/deployment-rest-api/56945>\
**Category:** Discussion & Questions\
**Created:** [November 14, 2024, 4:18pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945 "2024-11-14T16:18:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kayal\_Vizhi](https://forum.camunda.io/user_avatar/forum.camunda.io/kayal_vizhi/32/31262_2.png) [@Kayal\_Vizhi](https://forum.camunda.io/u/Kayal_Vizhi)\
**Post date:** [November 14, 2024, 4:18pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/1 "2024-11-14T16:18:04Z")

</div>

Hi,  
I have deployed camunda as a docker container using docker\_compose.yaml file (Camunda 8.6).  
I want to deploy the bpmn workflow file using REST API.  
But I could not able to deploy using curl command / postman.  
Using curl command:

```auto
    curl -X POST 'http://x.x.x.x:26500/v2/deployments' -H 'Content-Type: multipart/form-data' -H 'Accept: application/json' -F 'resources=@kayal_Demo_QOD_Workflow_1_testing.bpmn'
ERROR: curl: (1) Received HTTP/0.9 when not allowed

```

ZEEBE CONTAINER LOGS:

```auto
  Nov 14, 2024 10:26:12 AM io.grpc.netty.NettyServerTransport notifyTerminated
INFO: Transport failed
io.netty.handler.codec.http2.Http2Exception: Unexpected HTTP/1.x request: POST /v2/deployments
        at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:107)
        at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.readClientPrefaceString(Http2ConnectionHandler.java:315)
        at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:245)
        at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:451)
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799)
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Unknown Source)

```

Can anyone help to resolve this issue?

Thank you.

---

<div class="post-metadata">

**Author:** ![rohwerj](https://forum.camunda.io/user_avatar/forum.camunda.io/rohwerj/32/33352_2.png) [@rohwerj](https://forum.camunda.io/u/rohwerj)\
**Post date:** [November 14, 2024, 4:26pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/2 "2024-11-14T16:26:20Z")

</div>

Hi @Kayal_Vizhi and welcome to the forum.

The problem comes from the server expecting a HTTP2 request I think.  
Maybe this flag helps for the curl command:

```auto
--http2-prior-knowledge

```

See this link:

> <https://askubuntu.com/questions/1292987/curl-received-http-0-9-when-not-allowed-but-nghttp2-is-installed>

---

<div class="post-metadata">

**Author:** ![Kayal\_Vizhi](https://forum.camunda.io/user_avatar/forum.camunda.io/kayal_vizhi/32/31262_2.png) [@Kayal\_Vizhi](https://forum.camunda.io/u/Kayal_Vizhi)\
**Post date:** [November 14, 2024, 4:56pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/3 "2024-11-14T16:56:59Z")

</div>

Hi @rohwerj,  
Now I could able to access curl command.  
But after executing the curl ( Content-Type ‘multipart/form-data; boundary=------------------------c85114a79fddf60f’ is not supported) this error has been thrown.  
In the camunda 8, deployment REST API. Bpmn file and tenant id is required ,Which is form data format.

---

<div class="post-metadata">

**Author:** ![rohwerj](https://forum.camunda.io/user_avatar/forum.camunda.io/rohwerj/32/33352_2.png) [@rohwerj](https://forum.camunda.io/u/rohwerj)\
**Post date:** [November 14, 2024, 5:05pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/4 "2024-11-14T17:05:05Z")

</div>

Not really sure how this would look with curl.  
But I guess you need at least the option -F ‘tenantId=XXX’ to send the tenantId parameter.

---

<div class="post-metadata">

**Author:** ![Kayal\_Vizhi](https://forum.camunda.io/user_avatar/forum.camunda.io/kayal_vizhi/32/31262_2.png) [@Kayal\_Vizhi](https://forum.camunda.io/u/Kayal_Vizhi)\
**Post date:** [November 14, 2024, 5:09pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/5 "2024-11-14T17:09:52Z")

</div>

In the documentation of camunda 8 , it shows content type multipart/form-data. But after executing the command it is showing not supported. Could you please tell me the correct format for deployment REST API?

---

<div class="post-metadata">

**Author:** ![rohwerj](https://forum.camunda.io/user_avatar/forum.camunda.io/rohwerj/32/33352_2.png) [@rohwerj](https://forum.camunda.io/u/rohwerj)\
**Post date:** [November 14, 2024, 5:30pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/6 "2024-11-14T17:30:57Z")

</div>

I think it should be like this:

```auto
curl 'https://localhost'\
  --form "tenantId=XXX;type=text/plain"
  --form "resources=@process.bpmn;type=application/octet-stream"\

```

---

<div class="post-metadata">

**Author:** ![Kayal\_Vizhi](https://forum.camunda.io/user_avatar/forum.camunda.io/kayal_vizhi/32/31262_2.png) [@Kayal\_Vizhi](https://forum.camunda.io/u/Kayal_Vizhi)\
**Post date:** [November 15, 2024, 11:46am UTC](https://forum.camunda.io/t/deployment-rest-api/56945/7 "2024-11-15T11:46:14Z")

</div>

The curl command:  
curl --http2-prior-knowledge -X POST ‘[http://x.x.x.x:26500/v2/deployments](http://x.x.x.x:26500/v2/deployments)’ -H ‘Accept: application/json’ -F “tenantId=default;type=text/plain” -F ‘resources=@kayal\_Demo\_QOD\_Workflow\_1\_testing.bpmn;type=application/octet-stream’  
Error message:  
Content-Type ‘multipart/form-data; boundary=------------------------656300b0703b2523’ is not supported

Deployment REST API is not working.

---

<div class="post-metadata">

**Author:** ![GotnOGuts](https://forum.camunda.io/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@GotnOGuts](https://forum.camunda.io/u/GotnOGuts)\
**Post date:** [November 15, 2024, 5:16pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/8 "2024-11-15T17:16:19Z")

</div>

> [@Kayal\_Vizhi](#):
>
> ` curl -X POST 'http://x.x.x.x:26500/v2/deployments'`

Hi! Welcome to the forums!

From what I recall, the 26500 port is not the address of the REST interface, but the GRPC interface. This is also why it’s expecting http/2.

From the [Docker Compose File](https://github.com/camunda/camunda-platform/blob/87179c50f70209eb43a51541a47974267f4d02d2/docker-compose.yaml#L27) I would expect that the call should be something along the lines of

```auto
curl -X POST ‘http://x.x.x.x:8088/v2/deployments’ -H ‘Accept: application/json’ -F “tenantId=default;type=text/plain” -F ‘resources=@kayal_Demo_QOD_Workflow_1_testing.bpmn;type=application/octet-stream’

```

---

<div class="post-metadata">

**Author:** ![cpbpm](https://forum.camunda.io/letter_avatar_proxy/v4/letter/c/919ad9/32.png) [@cpbpm](https://forum.camunda.io/u/cpbpm)\
**Post date:** [November 15, 2024, 5:38pm UTC](https://forum.camunda.io/t/deployment-rest-api/56945/9 "2024-11-15T17:38:27Z")

</div>

As @GotnOGuts mentioned, 26500 is grpc port. Find out your Rest API Port from your configuration.

As we are running Self Hosted, we can skip the tenant details.

When I ran the command as it is, got the error, saying resource is not found. After fine tuning the call, able to deploy the bpmn using REST API.

Here is the result:

C:\camunda\v8\>curl -X POST “[http://192.168.101.152:8088/v2/deployments](http://192.168.101.152:8088/v2/deployments)” -H “Accept: application/json” -F “tenantId=default;type=text/plain” -F ‘resources=@demo.bpmn;type=application/octet-stream’  
**{“type”:“about:blank”,“title”:“Bad Request”,“status”:400,“detail”:“Required part ‘resources’ is not present.”,“instance”:“/v2/deployments”}**

C:\camunda\v8\>curl -X POST “[http://192.168.101.152:8088/v2/deployments](http://192.168.101.152:8088/v2/deployments)” -H “Accept: application/json” -F “resources=@demo.bpmn;type=application/octet-stream”

Result:

**{“deploymentKey”:2251799813695150,“deployments”:[{“processDefinition”:{“processDefinitionId”:“Process\_0tzg1e6”,“processDefinitionVersion”:1,“processDefinitionKey”:2251799813695151,“resourceName”:“demo.bpmn”,“tenantId”:“”}}],“tenantId”:“”}**

---

<div class="post-metadata">

**Author:** ![Kayal\_Vizhi](https://forum.camunda.io/user_avatar/forum.camunda.io/kayal_vizhi/32/31262_2.png) [@Kayal\_Vizhi](https://forum.camunda.io/u/Kayal_Vizhi)\
**Post date:** [November 18, 2024, 5:54am UTC](https://forum.camunda.io/t/deployment-rest-api/56945/10 "2024-11-18T05:54:40Z")

</div>

Thank you everyone.  
Now I could able to deploy bpmn workflow using REST API.

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [November 25, 2024, 5:55am UTC](https://forum.camunda.io/t/deployment-rest-api/56945/11 "2024-11-25T05:55:28Z")

</div>

Closed on November 25, 2024, 5:55am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
